lib/active_metadata/persistence/attachment.rb in active_metadata-0.7.6 vs lib/active_metadata/persistence/attachment.rb in active_metadata-0.7.7

- old
+ new

@@ -15,11 +15,11 @@ :starred => !!starred, :created_by => current_user_id, :group => group) reload_attachments_cache_for field - self.send(:send_notification, field, "", attachment.attach.original_filename, :attachment_message, current_user_id) + self.send(:send_notification, field, "", attachment.attach.original_filename, :new_attachment_message, current_user_id) end def attachments_for(field, order_by="updated_at DESC") Rails.cache.fetch(attachments_cache_key(field), :expires_in => ActiveMetadata::CONFIG['cache_expires_in'].minutes) do fetch_attachments_for field, nil, order_by @@ -29,11 +29,11 @@ def delete_attachment(id) a = ActiveMetadata::Attachment.find(id) filename, created_by = a.attach.original_filename, a.created_by a.destroy reload_attachments_cache_for a.label - self.send(:send_notification, a.label, filename, "", :attachment_message, created_by) + self.send(:send_notification, a.label, filename, "", :delete_attachment_message, created_by) end def update_attachment(id, newfile, starred=nil) a = ActiveMetadata::Attachment.find(id) old_filename = a.attach.original_filename @@ -42,10 +42,10 @@ a.starred = starred if !starred.nil? a.save! new_filename = a.attach.original_filename reload_attachments_cache_for a.label - self.send(:send_notification, a.label, old_filename, new_filename, :attachment_message, current_user_id) + self.send(:send_notification, a.label, old_filename, new_filename, :update_attachment_message, current_user_id) end def has_attachments_for field attachments_for(field).size == 0 ? false : true end