Class: DatastaxRails::Associations::Builder::CollectionAssociation

Inherits:
Association show all
Defined in:
lib/datastax_rails/associations/builder/collection_association.rb

Overview

:nodoc:

Direct Known Subclasses

HasAndBelongsToMany, HasMany

Constant Summary collapse

CALLBACKS =
[:before_add, :after_add, :before_remove, :after_remove]

Instance Attribute Summary

Attributes inherited from Association

#model, #name, #options, #reflection

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Association

#initialize, #mixin

Constructor Details

This class inherits a constructor from DatastaxRails::Associations::Builder::Association

Class Method Details

.build(model, name, options) ⇒ Object


7
8
9
# File 'lib/datastax_rails/associations/builder/collection_association.rb', line 7

def self.build(model, name, options)
  new(model, name, options).build
end

Instance Method Details

#buildObject


11
12
13
14
# File 'lib/datastax_rails/associations/builder/collection_association.rb', line 11

def build
  @reflection = super
  CALLBACKS.each { |callback_name| define_callback(callback_name) }
end

#writable?Boolean


16
17
18
# File 'lib/datastax_rails/associations/builder/collection_association.rb', line 16

def writable?
  true
end