Class: ActiveAdminAssociations::AssociationConfig::Association
- Inherits:
-
Object
- Object
- ActiveAdminAssociations::AssociationConfig::Association
- Defined in:
- lib/active_admin_associations/association_config.rb
Instance Attribute Summary collapse
-
#fields(*names) ⇒ Object
readonly
Returns the value of attribute fields.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #field(name) ⇒ Object
-
#initialize(name, fields = [], &block) ⇒ Association
constructor
A new instance of Association.
Constructor Details
#initialize(name, fields = [], &block) ⇒ Association
Returns a new instance of Association.
9 10 11 12 13 |
# File 'lib/active_admin_associations/association_config.rb', line 9 def initialize(name, fields = [], &block) @name = name.to_sym @fields = fields instance_exec(&block) if block_given? end |
Instance Attribute Details
#fields(*names) ⇒ Object (readonly)
Returns the value of attribute fields.
7 8 9 |
# File 'lib/active_admin_associations/association_config.rb', line 7 def fields @fields end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
6 7 8 |
# File 'lib/active_admin_associations/association_config.rb', line 6 def name @name end |
Instance Method Details
#field(name) ⇒ Object
15 16 17 |
# File 'lib/active_admin_associations/association_config.rb', line 15 def field(name) @fields << name end |