Class: RailsAdmin::Config::Fields::Types::BsonObjectId

Inherits:
String show all
Defined in:
lib/rails_admin/config/fields/types/bson_object_id.rb

Constant Summary

Constants inherited from Base

Base::NAMED_INSTANCE_VARIABLES

Instance Attribute Summary

Attributes inherited from Base

#abstract_model, #defined, #name, #order, #parent, #properties, #root, #section

Instance Method Summary collapse

Methods inherited from String

#input_size

Methods inherited from Base

#association?, #editable?, #errors, #form_default_value, #form_value, #generic_field_help, #initialize, #inverse_of, #method_name, #optional, #optional=, #optional?, #type, #type_css_class, #value, #virtual?

Methods included from Inspectable

#inspect

Methods included from Groupable

#group

Methods included from Hideable

#hidden?, #hide, included, #show

Methods included from Configurable

#has_option?, #register_deprecated_instance_option, #register_instance_option

Methods included from Proxyable

#bindings, #bindings=, #with

Constructor Details

This class inherits a constructor from RailsAdmin::Config::Fields::Base

Instance Method Details

#generic_helpObject


17
18
19
# File 'lib/rails_admin/config/fields/types/bson_object_id.rb', line 17

def generic_help
  'BSON::ObjectId'
end

#parse_input(params) ⇒ Object


33
34
35
# File 'lib/rails_admin/config/fields/types/bson_object_id.rb', line 33

def parse_input(params)
  params[name] = parse_value(params[name]) if params[name].is_a?(::String)
end

#parse_value(value) ⇒ Object


29
30
31
# File 'lib/rails_admin/config/fields/types/bson_object_id.rb', line 29

def parse_value(value)
  value.present? ? abstract_model.parse_object_id(value) : nil
end