Sha256: 2d389b232974944a000add862e36542eb144b874c1ff4cc4a466bf2fe6c785da

Contents?: true

Size: 679 Bytes

Versions: 10

Compression:

Stored size: 679 Bytes

Contents

require 'active_support/core_ext/string/inflections'
require 'rails_admin/config/fields'
require 'rails_admin/config/fields/association'

module RailsAdmin
  module Config
    module Fields
      module Types
        @@registry = {}

        def self.load(type)
          @@registry[type.to_sym] || fail("Unsupported field datatype: #{type}")
        end

        def self.register(type, klass = nil)
          if klass.nil? && type.is_a?(Class)
            klass = type
            type = klass.name.to_s.demodulize.underscore
          end
          @@registry[type.to_sym] = klass
        end

        require 'rails_admin/config/fields/types/all'
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
rails_admin-1.0.0.rc lib/rails_admin/config/fields/types.rb
rails_admin-0.8.1 lib/rails_admin/config/fields/types.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/rails_admin-0.7.0/lib/rails_admin/config/fields/types.rb
rails_admin-0.7.0 lib/rails_admin/config/fields/types.rb
rails_admin-0.6.8 lib/rails_admin/config/fields/types.rb
rails_admin-0.6.7 lib/rails_admin/config/fields/types.rb
rails_admin-0.6.6 lib/rails_admin/config/fields/types.rb
rails_admin-0.6.5 lib/rails_admin/config/fields/types.rb
rails_admin-0.6.4 lib/rails_admin/config/fields/types.rb
rails_admin-0.6.3 lib/rails_admin/config/fields/types.rb