Module: RailsAdmin::Config::Fields::Types
- Defined in:
- lib/rails_admin/config/fields/types.rb,
lib/rails_admin/config/fields/types/date.rb,
lib/rails_admin/config/fields/types/enum.rb,
lib/rails_admin/config/fields/types/text.rb,
lib/rails_admin/config/fields/types/time.rb,
lib/rails_admin/config/fields/types/color.rb,
lib/rails_admin/config/fields/types/float.rb,
lib/rails_admin/config/fields/types/hidden.rb,
lib/rails_admin/config/fields/types/string.rb,
lib/rails_admin/config/fields/types/boolean.rb,
lib/rails_admin/config/fields/types/decimal.rb,
lib/rails_admin/config/fields/types/integer.rb,
lib/rails_admin/config/fields/types/datetime.rb,
lib/rails_admin/config/fields/types/password.rb,
lib/rails_admin/config/fields/types/dragonfly.rb,
lib/rails_admin/config/fields/types/paperclip.rb,
lib/rails_admin/config/fields/types/timestamp.rb,
lib/rails_admin/config/fields/types/serialized.rb,
lib/rails_admin/config/fields/types/carrierwave.rb,
lib/rails_admin/config/fields/types/file_upload.rb,
lib/rails_admin/config/fields/types/bson_object_id.rb,
lib/rails_admin/config/fields/types/has_one_association.rb,
lib/rails_admin/config/fields/types/has_many_association.rb,
lib/rails_admin/config/fields/types/belongs_to_association.rb,
lib/rails_admin/config/fields/types/polymorphic_association.rb,
lib/rails_admin/config/fields/types/has_and_belongs_to_many_association.rb
Defined Under Namespace
Classes: BelongsToAssociation, Boolean, BsonObjectId, Carrierwave, Color, Date, Datetime, Decimal, Dragonfly, Enum, FileUpload, Float, HasAndBelongsToManyAssociation, HasManyAssociation, HasOneAssociation, Hidden, Integer, Paperclip, Password, PolymorphicAssociation, Serialized, String, Text, Time, Timestamp
Constant Summary
collapse
- @@registry =
{}
Class Method Summary
collapse
Class Method Details
.load(type) ⇒ Object
11
12
13
|
# 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) ⇒ Object
15
16
17
18
19
20
21
|
# 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
|