Class: Reactive::MetaModel::ActiveRecordModel::Association
- Inherits:
-
Association
- Object
- Association
- Reactive::MetaModel::ActiveRecordModel::Association
- Defined in:
- lib/activerecord_meta_model.rb
Instance Method Summary collapse
-
#initialize(association) ⇒ Association
constructor
A new instance of Association.
Constructor Details
#initialize(association) ⇒ Association
Returns a new instance of Association.
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/activerecord_meta_model.rb', line 51 def initialize(association) @name, @kind, @klass = association.name.to_sym, association.macro, association.klass @polymorphic = association.[:polymorphic] # TODO: has_* don't have attributes in their table, so avoid these attributes (they may clash with real attributes!) @columns = [ association.primary_key_name, association.[:foreign_type], association.counter_cache_column ].compact.map(&:to_sym) end |