Class: Relaxo::Model::Properties::HasMany
- Inherits:
-
HasOne
show all
- Defined in:
- lib/relaxo/model/properties/composite.rb
Instance Method Summary
collapse
Methods inherited from BelongsTo
[], #initialize
Instance Method Details
#convert_from_primative(database, value) ⇒ Object
109
110
111
|
# File 'lib/relaxo/model/properties/composite.rb', line 109
def convert_from_primative(database, value)
value.collect{|id| @klass.fetch(database, id)}
end
|
#convert_to_primative(value) ⇒ Object
101
102
103
104
105
106
107
|
# File 'lib/relaxo/model/properties/composite.rb', line 101
def convert_to_primative(value)
value.each do |document|
document.save unless document.saved?
end
value.collect{|document| document.id}
end
|