lib/medea/meta_properties.rb in medea-0.5.4 vs lib/medea/meta_properties.rb in medea-0.6.0

- old
+ new

@@ -26,9 +26,17 @@ #also modify the items in the list so that they know that they're owned #list_type.class_variable_set :@@owner, self list_class.owned = true end + def has_attachment attachment_name + attachments = [] + attachments = self.send(:class_variable_get, :@@attachments) if self.class_variable_defined? :@@attachments + attachments << attachment_name + attachments.uniq! + self.send(:class_variable_set, "@@attachments", attachments) + end + def key_field field_name #this field must be present to save, and it must be unique self.send(:class_variable_set, :@@key_field, field_name) end end \ No newline at end of file