active_metadata 0.7.6 → 0.7.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -84,3 +84,7 @@ end
84
84
  Then /^should record the current_user_id in the created_by$/ do
85
85
  @notifier.created_by.to_i.should == User.current.id
86
86
  end
87
+
88
+ Then /^should record the "([^"]*)" in type$/ do |type|
89
+ @notifier.type.to_s.should eq type
90
+ end
@@ -20,7 +20,8 @@ Feature: Trigger alert on modify
20
20
  And should record the "pippo" in the old_value
21
21
  And should record the "history_message" in the type
22
22
  And should record the current_user_id in the created_by
23
-
23
+ And should record the "history_message" in type
24
+
24
25
  Scenario: receive a new alert in the inbox when a note of a field is added
25
26
  Given a watcher on the "name" field
26
27
  When creating a new note on the "name" field with content "new note!"
@@ -29,10 +30,10 @@ Feature: Trigger alert on modify
29
30
  And should record the "Document" model class
30
31
  And should record the "new note!" in the new_value
31
32
  And should record the "" in the old_value
32
- And should record the "note_message" in the type
33
+ And should record the "new_note_message" in the type
33
34
  And should record the current_user_id in the created_by
34
35
 
35
- Scenario: receive a new alert in the inbox when a note of a field is updated
36
+ Scenario: receive a new alert in the inbox when a note of a field is updated
36
37
  Given a watcher on the "name" field
37
38
  When creating a new note on the "name" field with content "new note!"
38
39
  And afterwards I update the note on the field "name" with content "updated note!"
@@ -41,7 +42,7 @@ Feature: Trigger alert on modify
41
42
  And should record the "Document" model class
42
43
  And should record the "new note!" in the old_value
43
44
  And should record the "updated note!" in the new_value
44
- And should record the "note_message" in the type
45
+ And should record the "update_note_message" in the type
45
46
  And should record the current_user_id in the created_by
46
47
 
47
48
  Scenario: receive a new alert in the inbox when a note of a field is deleted
@@ -53,7 +54,7 @@ Feature: Trigger alert on modify
53
54
  And should record the "Document" model class
54
55
  And should record the "new note!" in the old_value
55
56
  And should record the "" in the new_value
56
- And should record the "note_message" in the type
57
+ And should record the "delete_note_message" in the type
57
58
  And should record the current_user_id in the created_by
58
59
 
59
60
  Scenario: receive a new alert in the inbox when a attachment of a field is created
@@ -64,7 +65,7 @@ Feature: Trigger alert on modify
64
65
  And should record the "Document" model class
65
66
  And should record the "file.txt" in the new_value
66
67
  And should record the "" in the old_value
67
- And should record the "attachment_message" in the type
68
+ And should record the "new_attachment_message" in the type
68
69
  And should record the current_user_id in the created_by
69
70
 
70
71
  Scenario: receive a new alert in the inbox when a attachment of a field is updated
@@ -76,7 +77,7 @@ Feature: Trigger alert on modify
76
77
  And should record the "Document" model class
77
78
  And should record the "updated_file.txt" in the new_value
78
79
  And should record the "file.txt" in the old_value
79
- And should record the "attachment_message" in the type
80
+ And should record the "update_attachment_message" in the type
80
81
  And should record the current_user_id in the created_by
81
82
 
82
83
  Scenario: receive a new alert in the inbox when a attachment of a field is deleted
@@ -88,5 +89,5 @@ Feature: Trigger alert on modify
88
89
  And should record the "Document" model class
89
90
  And should record the "" in the new_value
90
91
  And should record the "file.txt" in the old_value
91
- And should record the "attachment_message" in the type
92
+ And should record the "delete_attachment_message" in the type
92
93
  And should record the current_user_id in the created_by
@@ -17,7 +17,7 @@ module ActiveMetadata::Persistence::Attachment
17
17
  :group => group)
18
18
 
19
19
  reload_attachments_cache_for field
20
- self.send(:send_notification, field, "", attachment.attach.original_filename, :attachment_message, current_user_id)
20
+ self.send(:send_notification, field, "", attachment.attach.original_filename, :new_attachment_message, current_user_id)
21
21
  end
22
22
 
23
23
  def attachments_for(field, order_by="updated_at DESC")
@@ -31,7 +31,7 @@ module ActiveMetadata::Persistence::Attachment
31
31
  filename, created_by = a.attach.original_filename, a.created_by
32
32
  a.destroy
33
33
  reload_attachments_cache_for a.label
34
- self.send(:send_notification, a.label, filename, "", :attachment_message, created_by)
34
+ self.send(:send_notification, a.label, filename, "", :delete_attachment_message, created_by)
35
35
  end
36
36
 
37
37
  def update_attachment(id, newfile, starred=nil)
@@ -44,7 +44,7 @@ module ActiveMetadata::Persistence::Attachment
44
44
  new_filename = a.attach.original_filename
45
45
 
46
46
  reload_attachments_cache_for a.label
47
- self.send(:send_notification, a.label, old_filename, new_filename, :attachment_message, current_user_id)
47
+ self.send(:send_notification, a.label, old_filename, new_filename, :update_attachment_message, current_user_id)
48
48
  end
49
49
 
50
50
  def has_attachments_for field
@@ -12,7 +12,7 @@ module ActiveMetadata::Persistence::History
12
12
  next if ActiveMetadata::CONFIG['history_skip_fields'].include?(key)
13
13
  ActiveMetadata::History.create! :value => value[1],:document_class => metadata_class, :document_id => metadata_id,:label => key.to_s, :created_by => current_user_id
14
14
  invalidate_history_cache_for key.to_s
15
- self.send(:send_notification, key, value[0], value[1], :history_message,current_user_id)
15
+ self.send(:send_notification, key, value[0], value[1], :history_message, current_user_id)
16
16
  end
17
17
  end
18
18
 
@@ -17,7 +17,7 @@ module ActiveMetadata::Persistence::Note
17
17
  :group => group)
18
18
 
19
19
  reload_notes_cache_for field
20
- self.send(:send_notification, field, "", note, :note_message, current_user_id)
20
+ self.send(:send_notification, field, "", note, :new_note_message, current_user_id)
21
21
  end
22
22
 
23
23
  def update_note(id, note, starred=nil)
@@ -30,7 +30,7 @@ module ActiveMetadata::Persistence::Note
30
30
  end
31
31
  n.update_attributes! attributes
32
32
  reload_notes_cache_for n.label
33
- self.send(:send_notification, n.label, old_value, note, :note_message, current_user_id)
33
+ self.send(:send_notification, n.label, old_value, note, :update_note_message, current_user_id)
34
34
  end
35
35
 
36
36
  def notes_for(field, order_by="updated_at DESC")
@@ -52,7 +52,7 @@ module ActiveMetadata::Persistence::Note
52
52
  old_value, created_by = note.note, note.created_by
53
53
  note.destroy
54
54
  reload_notes_cache_for note.label
55
- self.send(:send_notification, note.label, old_value, "", :note_message, created_by)
55
+ self.send(:send_notification, note.label, old_value, "", :delete_note_message, created_by)
56
56
  end
57
57
 
58
58
  def has_notes_for field
@@ -1,3 +1,3 @@
1
1
  module ActiveMetadata
2
- VERSION = "0.7.6"
2
+ VERSION = "0.7.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_metadata
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.6
4
+ version: 0.7.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -261,7 +261,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
261
261
  version: '0'
262
262
  segments:
263
263
  - 0
264
- hash: 1997960578253629340
264
+ hash: -3740493897087200554
265
265
  required_rubygems_version: !ruby/object:Gem::Requirement
266
266
  none: false
267
267
  requirements:
@@ -270,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
270
  version: '0'
271
271
  segments:
272
272
  - 0
273
- hash: 1997960578253629340
273
+ hash: -3740493897087200554
274
274
  requirements: []
275
275
  rubyforge_project: active_metadata
276
276
  rubygems_version: 1.8.19