Class: SimplyCouch::Model::HasManyEmbedded::Property
- Inherits:
-
AssociationProperty
- Object
- AssociationProperty
- SimplyCouch::Model::HasManyEmbedded::Property
- Defined in:
- lib/simply_couch/model/has_many_embedded.rb
Instance Attribute Summary
Attributes inherited from AssociationProperty
Instance Method Summary collapse
-
#initialize(owner_clazz, name, options = {}) ⇒ Property
constructor
A new instance of Property.
Methods inherited from AssociationProperty
#association?, #build, #dirty?, #serialize, #supports_dirty?
Constructor Details
#initialize(owner_clazz, name, options = {}) ⇒ Property
Returns a new instance of Property.
160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 |
# File 'lib/simply_couch/model/has_many_embedded.rb', line 160 def initialize(owner_clazz, name, = {}) = { :dependent => :nullify, :through => nil, :class_name => name.to_s.singularize.camelize, :foreign_key => nil }.update() @name, @options = name, .assert_valid_keys(:dependent, :through, :class_name, :foreign_key) owner_clazz.class_eval do property name, :type => Array _define_cache_accessors(name, ) (name, ) (name, ) (name, ) (name, ) (name, ) define_reset_index_values(name, ) (name, ) end end |