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

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

Instance Attribute Summary

Attributes inherited from Base

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

Attributes included from Proxyable

#bindings

Instance Method Summary collapse

Methods inherited from Base

#association?, #editable?, #errors, #html_default_value, #initialize, #inspect, #inverse_of, #method_name, #optional, #optional=, #optional?, #type, #type_css_class, #value, #virtual?

Methods included from Groupable

#group

Methods included from Hideable

#hidden?, #hide, included, #show

Methods included from Configurable

#has_option?, included, #register_deprecated_instance_option, #register_instance_option

Methods included from Proxyable

#with

Constructor Details

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

Instance Method Details

#parse_input(params) ⇒ Object



29
30
31
32
33
34
35
36
37
# File 'lib/rails_admin/config/fields/types/bson_object_id.rb', line 29

def parse_input(params)
  begin
    params[name] = (params[name].blank? ? nil : abstract_model.object_id_from_string(params[name])) if params[name].is_a?(::String)
  rescue => e
    unless ['BSON::InvalidObjectId', 'Moped::Errors::InvalidObjectId'].include? e.class.to_s
      raise e
    end
  end
end