change_manager 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b7b51b088de260186aed7aaca3b92628b531cac
4
- data.tar.gz: 587ef2dea59593022e157febd1a887960fb04fa7
3
+ metadata.gz: 0b9c9c513f77fb833860b3c26a319ecf24402b48
4
+ data.tar.gz: c9925e9f544d6e52a4334c74c9a4e38dc27cd456
5
5
  SHA512:
6
- metadata.gz: e9568d48266a785d8ffefb171236de8f3a447dbcb6481aeffb80525f44f86444e088a5c94ead6d9825b0727987e9fdc4f6c5ad2ac662089e4cd48e2c871b826b
7
- data.tar.gz: 9aecf91595c256073cdc66dc62cb01ae9967e4b6358ee18d87565d54ad99499eafdcc22b77f779c76302e173307b6b8b103407ede0c46ff12d390e6d3af17175
6
+ metadata.gz: c6550dbb12bcc851ee867b606ec6387b94c9ffcc7808e5b1acb240a77e85e79d13a5aad425e8cacd641e5526c2c301cd962d44d89004fb3a46278a6c69a0d038
7
+ data.tar.gz: 8f06f841a61202d21168f32581a751df349ea0344da2fdb5f77356ee6a358629d99b1da14528835eae93340a397229208eec21ff5c85ef0fa3650f64f557dc0a
@@ -10,9 +10,9 @@ module ChangeManager
10
10
  puts 'notify method called'
11
11
  unless Change.find(change_id).cancelled?
12
12
  change = Change.find(change_id)
13
- similar_changes = group_similar_changes(change.owner, change.target)
13
+ verified_changes = cancel_all_changes(group_similar_changes(change.owner, change.target))
14
14
  mailer = ChangeManager::NotificationMailer
15
- puts 'email sent' if mailer.send_email(mailer.construct_email(similar_changes))
15
+ puts 'email sent' if mailer.send_email(mailer.construct_email(verified_changes))
16
16
  end
17
17
  end
18
18
 
@@ -36,5 +36,13 @@ module ChangeManager
36
36
  end
37
37
  return similar_changes
38
38
  end
39
+
40
+ def self.cancel_all_changes(verified_changes)
41
+ verified_changes.each do |change|
42
+ change.cancel
43
+ end
44
+ verified_changes
45
+ end
46
+
39
47
  end
40
48
  end
@@ -1,3 +1,3 @@
1
1
  module ChangeManager
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: change_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kyle Lawhorn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-18 00:00:00.000000000 Z
11
+ date: 2016-05-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails