Sha256: 291e7949d833c9557c467289d52d83a4abff1814c3f9bb47bf315b0812c2461d
Contents?: true
Size: 631 Bytes
Versions: 13
Compression:
Stored size: 631 Bytes
Contents
# Groups methods and additions that were used but are not readily available in # all supported Rails versions. class Hash unless {}.respond_to?(:deep_merge) # Imported from Rails 2.2 def deep_merge(other_hash) self.merge(other_hash) do |key, oldval, newval| oldval = oldval.to_hash if oldval.respond_to?(:to_hash) newval = newval.to_hash if newval.respond_to?(:to_hash) oldval.class.to_s == 'Hash' && newval.class.to_s == 'Hash' ? oldval.deep_merge(newval) : newval end end end end class String unless "".respond_to?(:html_safe) def html_safe self end end end
Version data entries
13 entries across 13 versions & 4 rubygems