Class: ActiveData::Model::Associations::Reflections::EmbedsMany

Inherits:
Base
  • Object
show all
Defined in:
lib/active_data/model/associations/reflections/embeds_many.rb

Constant Summary

Constants inherited from Base

Base::READ, Base::WRITE

Instance Attribute Summary

Attributes inherited from Base

#name, #options, #parent_reflection

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

association_class, #belongs_to?, #build_association, #default, generate_methods, #initialize, #inspect, #klass, #macro, #read_source, #write_source

Constructor Details

This class inherits a constructor from ActiveData::Model::Associations::Reflections::Base

Class Method Details

.build(target, generated_methods, name, options = {}, &block) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/active_data/model/associations/reflections/embeds_many.rb', line 6

def self.build target, generated_methods, name, options = {}, &block
  if target < ActiveData::Model::Attributes
    target.add_attribute(ActiveData::Model::Attributes::Reflections::Base, name)
  end
  options[:validate] = true unless options.key?(:validate)
  super
end

Instance Method Details

#collection?Boolean

Returns:



14
15
16
# File 'lib/active_data/model/associations/reflections/embeds_many.rb', line 14

def collection?
  true
end

#embedded?Boolean

Returns:



18
19
20
# File 'lib/active_data/model/associations/reflections/embeds_many.rb', line 18

def embedded?
  true
end