Sha256: 41e0546b748e19eb27e71a24c2bc084f5e5e2f548675fda755344842c524f537

Contents?: true

Size: 757 Bytes

Versions: 14

Compression:

Stored size: 757 Bytes

Contents

require 'sequel_rails/version'
require 'sequel_rails/railtie' if defined? Rails
require 'English'

module SequelRails
  def self.jruby?
    (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby') || defined?(JRUBY_VERSION)
  end

  if Hash.public_instance_methods.include? :deep_symbolize_keys
    def self.deep_symbolize_keys(hash)
      hash.deep_symbolize_keys
    end
  else
    def self.deep_symbolize_keys(hash)
      h = {}
      hash.each { |key, value| h[key.to_sym] = deep_symbolize_keys_map(value) }
      h
    end

    def self.deep_symbolize_keys_map(value)
      case value
      when Hash
        deep_symbolize_keys(value)
      when Array
        value.map { |v| deep_symbolize_keys_map(v) }
      else
        value
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
sequel-rails-1.2.3 lib/sequel_rails.rb
sequel-rails-1.2.2 lib/sequel_rails.rb
sequel-rails-1.2.1 lib/sequel_rails.rb
sequel-rails-1.2.0 lib/sequel_rails.rb
sequel-rails-1.1.1 lib/sequel_rails.rb
sequel-rails-1.1.0 lib/sequel_rails.rb
sequel-rails-1.0.1 lib/sequel_rails.rb
sequel-rails-1.0.0 lib/sequel_rails.rb
sequel-rails-0.9.17 lib/sequel_rails.rb
sequel-rails-0.9.16 lib/sequel_rails.rb
sequel-rails-0.9.15 lib/sequel_rails.rb
sequel-rails-0.9.14 lib/sequel_rails.rb
sequel-rails-0.9.13 lib/sequel_rails.rb
sequel-rails-0.9.12 lib/sequel_rails.rb