module RailsAdmin::Config::Fields::Types

Public Class Methods

load(type) click to toggle source
# File lib/rails_admin/config/fields/types.rb, line 11
def self.load(type)
  @@registry[type.to_sym] or raise "Unsupported field datatype: #{type}"
end
register(type, klass = nil) click to toggle source
# File lib/rails_admin/config/fields/types.rb, line 15
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