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

Version Path
zeiv-declarative_authorization-1.0.0.pre lib/declarative_authorization/rails_legacy.rb
declarative_authorization-0.5.7 lib/declarative_authorization/rails_legacy.rb
declarative_authorization-0.5.6 lib/declarative_authorization/rails_legacy.rb
declarative_authorization-0.5.5 lib/declarative_authorization/rails_legacy.rb
declarative_authorization-0.5.4 lib/declarative_authorization/rails_legacy.rb
declarative_authorization-0.5.3 lib/declarative_authorization/rails_legacy.rb
graylog2-declarative_authorization-0.5.2 lib/declarative_authorization/rails_legacy.rb
declarative_authorization-0.5.2 lib/declarative_authorization/rails_legacy.rb
declarative_authorization-dta-0.1.3 lib/declarative_authorization/rails_legacy.rb
declarative_authorization-0.5.1 lib/declarative_authorization/rails_legacy.rb
declarative_authorization-dta-0.1.1 lib/declarative_authorization/rails_legacy.rb
declarative_authorization-dta-0.1 lib/declarative_authorization/rails_legacy.rb
declarative_authorization-0.5 lib/declarative_authorization/rails_legacy.rb