lib/spontaneous/collections/field_set.rb in spontaneous-0.1.0.alpha1 vs lib/spontaneous/collections/field_set.rb in spontaneous-0.2.0.alpha1
- old
+ new
@@ -12,11 +12,11 @@
end
def initialize_from_prototypes(initial_values)
values = (initial_values || []).map do |value|
value = S::FieldTypes.deserialize_field(value)
- [Spontaneous::Schema::UID[value[:id]], value]
+ [Spontaneous.schema.uids[value[:id]], value]
end
values = Hash[values]
owner.field_prototypes.each do |field_prototype|
field = field_prototype.to_field(values[field_prototype.schema_id])
add_field(field)
@@ -25,12 +25,12 @@
def serialize_db
self.map { |field| field.serialize_db }
end
- def export
+ def export(user)
owner.class.field_names.map do |name|
- self[name].export
+ self[name].export(user)
end
end
def saved
self.each { |field| field.mark_unmodified }