Class: RailsAdmin::Config::Fields::Types::HasOneAssociation

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

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, #associated_model_config, #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

#method_nameObject



24
25
26
# File 'lib/rails_admin/config/fields/types/has_one_association.rb', line 24

def method_name
  "#{name}_id"
end

#selected_idObject



20
21
22
# File 'lib/rails_admin/config/fields/types/has_one_association.rb', line 20

def selected_id
  value.try :id
end