Class: RailsAdmin::Adapters::Mongoid::Association
- Inherits:
-
Object
- Object
- RailsAdmin::Adapters::Mongoid::Association
- Defined in:
- lib/rails_admin/adapters/mongoid.rb
Instance Attribute Summary collapse
-
#association ⇒ Object
readonly
Returns the value of attribute association.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#initialize(association, model) ⇒ Association
constructor
A new instance of Association.
- #to_options_hash ⇒ Object
Constructor Details
#initialize(association, model) ⇒ Association
Returns a new instance of Association.
267 268 269 270 271 |
# File 'lib/rails_admin/adapters/mongoid.rb', line 267 def initialize(association, model) @association = association @model = model @options = association. end |
Instance Attribute Details
#association ⇒ Object (readonly)
Returns the value of attribute association.
266 267 268 |
# File 'lib/rails_admin/adapters/mongoid.rb', line 266 def association @association end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
266 267 268 |
# File 'lib/rails_admin/adapters/mongoid.rb', line 266 def model @model end |
Instance Method Details
#to_options_hash ⇒ Object
273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 |
# File 'lib/rails_admin/adapters/mongoid.rb', line 273 def { :name => name.to_sym, :pretty_name => display_name, :type => type_lookup, :model_proc => Proc.new { model_proc_lookup }, :primary_key_proc => Proc.new { primary_key_lookup }, :foreign_key => foreign_key_lookup, :foreign_type => foreign_type_lookup, :foreign_inverse_of => foreign_inverse_of_lookup, :as => as_lookup, :polymorphic => polymorphic_lookup, :inverse_of => inverse_of_lookup, :read_only => nil, :nested_form => } end |