Sha256: 0d8a6500724e6755943f797995c9c87a96acfed8ab9779091f2ba0829955bddd

Contents?: true

Size: 642 Bytes

Versions: 3

Compression:

Stored size: 642 Bytes

Contents

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

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

        def self.load(type)
          @@registry[type.to_sym] or logger.info "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

3 entries across 3 versions & 1 rubygems

Version Path
obitum-rails_admin-0.0.3 lib/rails_admin/config/fields/types.rb
obitum-rails_admin-0.0.2 lib/rails_admin/config/fields/types.rb
obitum-rails_admin-0.0.1 lib/rails_admin/config/fields/types.rb