Sha256: 9e0d2dfe0d344092107ee5460939c6c4532fed9412421aa6b1411210526021c7

Contents?: true

Size: 684 Bytes

Versions: 27

Compression:

Stored size: 684 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] or raise "Unsupported field datatype: #{type}"
        end

        def self.register(type, klass = nil)
          if klass == nil && type.kind_of?(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

27 entries across 27 versions & 5 rubygems

Version Path
rails_admin-0.6.0 lib/rails_admin/config/fields/types.rb
rails_admin-0.5.0 lib/rails_admin/config/fields/types.rb
rails_admin-0.4.9 lib/rails_admin/config/fields/types.rb
rails_admin-0.4.8 lib/rails_admin/config/fields/types.rb
rails_admin-0.4.7 lib/rails_admin/config/fields/types.rb
rails_admin-0.4.6 lib/rails_admin/config/fields/types.rb
rails_admin-0.4.5 lib/rails_admin/config/fields/types.rb
rails_admin-0.4.4 lib/rails_admin/config/fields/types.rb
rails_admin-lbgraham-0.4.2 lib/rails_admin/config/fields/types.rb
rails_admin-0.4.3 lib/rails_admin/config/fields/types.rb
rails_admin-0.4.2 lib/rails_admin/config/fields/types.rb
rails_admin-0.4.1 lib/rails_admin/config/fields/types.rb
rails_admin-0.4.0 lib/rails_admin/config/fields/types.rb
rails_admin-0.3.0 lib/rails_admin/config/fields/types.rb
rails_admin-0.2.0 lib/rails_admin/config/fields/types.rb
rails_admin-0.1.2 lib/rails_admin/config/fields/types.rb
rails_admin-0.1.1 lib/rails_admin/config/fields/types.rb
rails_admin-0.1.0 lib/rails_admin/config/fields/types.rb
rails_admin-0.0.5 lib/rails_admin/config/fields/types.rb
rails_admin-0.0.4 lib/rails_admin/config/fields/types.rb