Class: Impressionist::SetupAssociation
- Inherits:
-
Object
- Object
- Impressionist::SetupAssociation
- Defined in:
- lib/impressionist/setup_association.rb
Overview
Impressionist::SetupAssociation.new(entity).set
Instance Method Summary collapse
- #define_belongs_to ⇒ Object
-
#include_attr_acc? ⇒ Boolean
True or False Note toggle returns false if rails >= 4.
-
#initialize(receiver) ⇒ SetupAssociation
constructor
A new instance of SetupAssociation.
- #set ⇒ Object
Constructor Details
#initialize(receiver) ⇒ SetupAssociation
Returns a new instance of SetupAssociation.
4 5 6 |
# File 'lib/impressionist/setup_association.rb', line 4 def initialize(receiver) @receiver = receiver end |
Instance Method Details
#define_belongs_to ⇒ Object
14 15 16 |
# File 'lib/impressionist/setup_association.rb', line 14 def define_belongs_to receiver.belongs_to(:impressionable, :polymorphic => true) end |
#include_attr_acc? ⇒ Boolean
True or False Note toggle returns false if rails >= 4
10 11 12 |
# File 'lib/impressionist/setup_association.rb', line 10 def include_attr_acc? toggle && make_accessible end |
#set ⇒ Object
18 19 20 21 |
# File 'lib/impressionist/setup_association.rb', line 18 def set define_belongs_to include_attr_acc? end |