delay_henka 0.2.2 → 0.2.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: 3005f11e612f403e705bf989998e6aad752c88f5
4
- data.tar.gz: fac7c914ed39c4009311bcd63293e9fc11a3fce8
3
+ metadata.gz: eb75d752ce445a7666cf10ee57afa65cf5db7921
4
+ data.tar.gz: 1c2878c9807c1481e716375936692b6d4eb73d09
5
5
  SHA512:
6
- metadata.gz: 1d6aadd6f2ddecbd3abe95d74783f3947ec363d932988b7c9d16ef951423ea6ed97a2241b354d334c12dfbbeae1ddb43291c05eb5e4e7330ee071a71912f66d6
7
- data.tar.gz: 0f1afcc612f302076eedefafd2f38c18bdf458d4fdcbbc71d3e688755579582eb26548a87d022da965122e538ac9c33b1c8de446a4e816a404a9f106a4a6f270
6
+ metadata.gz: e94b1d649d511e4cf95b87d773f54ac192dbc0c913328dfa55261977a5d3abe404c098d9afdf7fab76e88c97ca7221d66c66423bd887cf7d82d4da5d4b615eda
7
+ data.tar.gz: 8a8188f64a2a07b5f1a0e65de30e5e06a80b49a79df6b167898bc55fd12930fcdd040facad07778aeca6b1c14626bfe11c14cd99eb34a8bc488d6f5ffd75ad95
@@ -18,10 +18,10 @@ module DelayHenka
18
18
 
19
19
  def self.schedule(record:, changes:, by_id:)
20
20
  changes.each do |attribute, new_val|
21
- old_val = record.public_send(attribute)
22
21
  cleaned_new_val = cleanup_val(new_val)
23
- next if old_val == cleaned_new_val
24
- create!(changeable: record, submitted_by_id: by_id, attribute_name: attribute, old_value: old_val, new_value: cleaned_new_val)
22
+ record.public_send("#{attribute}=", cleaned_new_val)
23
+ next unless record.public_send("#{attribute}_changed?")
24
+ create!(changeable: record, submitted_by_id: by_id, attribute_name: attribute, old_value: record.public_send(attribute), new_value: cleaned_new_val)
25
25
  end
26
26
  end
27
27
 
@@ -1,3 +1,3 @@
1
1
  module DelayHenka
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: delay_henka
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - zino
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-23 00:00:00.000000000 Z
11
+ date: 2019-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails