Class Hash
In: lib/declarative_authorization/rails_legacy.rb
Parent: Object

Groups methods and additions that were used but are not readily available in all supported Rails versions.

Methods

Public Instance methods

Imported from Rails 2.2

[Source]

    # File lib/declarative_authorization/rails_legacy.rb, line 6
 6:     def deep_merge(other_hash)
 7:       self.merge(other_hash) do |key, oldval, newval|
 8:         oldval = oldval.to_hash if oldval.respond_to?(:to_hash)
 9:         newval = newval.to_hash if newval.respond_to?(:to_hash)
10:         oldval.class.to_s == 'Hash' && newval.class.to_s == 'Hash' ? oldval.deep_merge(newval) : newval
11:       end
12:     end

[Validate]