delay_henka 0.2.3 → 0.2.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/models/delay_henka/scheduled_change.rb +2 -1
- data/lib/delay_henka/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a9dc7cc926b1cce96ff3d2d7d5b2cbc17e05d92d
|
4
|
+
data.tar.gz: 84415334ddc990bdd629f1e75a546ba6d5b770de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6c3c885759872583eda50b5ae942f5c828b17fcd864363fc59466e519fe0385ff418cc2a9e38ccc629460e6262a6f991796ed49ca13ddfde38cdf27e1805a86
|
7
|
+
data.tar.gz: b41d6278d9c2374b0a587406ea9bd4b3caef9acbe5bab1ddce2b9c6afdf4e7d4a4febea3df216e016e4842d479dcc26262f6d1d1bc6de49cfddae266581132d6
|
@@ -18,10 +18,11 @@ 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)
|
21
22
|
cleaned_new_val = cleanup_val(new_val)
|
22
23
|
record.public_send("#{attribute}=", cleaned_new_val)
|
23
24
|
next unless record.public_send("#{attribute}_changed?")
|
24
|
-
create!(changeable: record, submitted_by_id: by_id, attribute_name: attribute, old_value:
|
25
|
+
create!(changeable: record, submitted_by_id: by_id, attribute_name: attribute, old_value: old_val, new_value: cleaned_new_val)
|
25
26
|
end
|
26
27
|
end
|
27
28
|
|
data/lib/delay_henka/version.rb
CHANGED