Class: Formed::Associations::Builder::CollectionAssociation

Inherits:
Association
  • Object
show all
Defined in:
lib/formed/associations/builder/collection_association.rb

Overview

:nodoc:

Direct Known Subclasses

HasMany

Constant Summary collapse

CALLBACKS =
i[before_add after_add before_remove after_remove].freeze

Constants inherited from Association

Association::VALID_OPTIONS

Class Method Summary collapse

Methods inherited from Association

build, create_reflection

Class Method Details

.define_callbacks(model, reflection) ⇒ Object



13
14
15
16
17
18
19
20
# File 'lib/formed/associations/builder/collection_association.rb', line 13

def self.define_callbacks(model, reflection)
  super
  name    = reflection.name
  options = reflection.options
  CALLBACKS.each do |callback_name|
    define_callback(model, callback_name, name, options)
  end
end