Class: RailsAdmin::Config::Fields::Types::BelongsToAssociation

Inherits:
Association show all
Defined in:
lib/rails_admin/config/fields/types/belongs_to_association.rb

Direct Known Subclasses

PolymorphicAssociation

Instance Attribute Summary

Attributes inherited from Base

#defined, #name, #order, #properties

Attributes inherited from Base

#abstract_model, #bindings, #parent, #root

Instance Method Summary collapse

Methods inherited from Association

#associated_label_method, #association, #child_key, #errors, inherited, #inverse_of, #polymorphic?, #value

Methods inherited from Base

#association?, #column_css_class, #dom_id, #dom_name, #errors, #has_errors?, inherited, #initialize, #optional, #optional=, #optional?, #type, #value, #virtual?

Methods included from Hideable

#hidden?, #hide, included, #show

Methods inherited from Base

#has_option?, #initialize, register_class_option, #register_deprecated_instance_option, register_deprecated_instance_option, #register_instance_option, register_instance_option, #with

Constructor Details

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

Instance Method Details

#associated_model_configObject



36
37
38
# File 'lib/rails_admin/config/fields/types/belongs_to_association.rb', line 36

def associated_model_config
  @config ||= RailsAdmin.config(association[:parent_model])
end

#method_nameObject



44
45
46
# File 'lib/rails_admin/config/fields/types/belongs_to_association.rb', line 44

def method_name
  association[:child_key]
end

#selected_idObject



40
41
42
# File 'lib/rails_admin/config/fields/types/belongs_to_association.rb', line 40

def selected_id
  bindings[:object].send(child_key)
end