delay_henka 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/services/delay_henka/whether_schedule.rb +7 -2
- data/lib/delay_henka/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf9acc4e30db7c0f47c10533484a3de78ff68248
|
4
|
+
data.tar.gz: cb0e70029c91a2f67504890493af03aabb6e9872
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74338132118c97ec2c5e521bfdd9e30081f0ee258295f05e56c9a7820f6a2d0ee81060c23a1c9071e961f224b7ca41fe6b6f398a4acb15179ab260c5d2d1496e
|
7
|
+
data.tar.gz: aa320fbe416ede808b658e10e21d5ee2e8c7d875d1d9715091c49fafcf6d5971d72689ed1890c977b283001a816d31221c5df356f4d5f4eaac2f17fdcab0fc92
|
@@ -2,14 +2,19 @@ module DelayHenka
|
|
2
2
|
class WhetherSchedule
|
3
3
|
|
4
4
|
def initialize(record)
|
5
|
-
@record = record
|
5
|
+
@record = record
|
6
6
|
end
|
7
7
|
|
8
8
|
def make_decision(attribute, new_val)
|
9
|
+
evaluate_decision(attribute, new_val).tap do
|
10
|
+
@record.restore_attributes
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def evaluate_decision(attribute, new_val)
|
9
15
|
Keka.run do
|
10
16
|
old_val = record.public_send(attribute)
|
11
17
|
record.public_send("#{attribute}=", new_val)
|
12
|
-
# can't use xxx_changed? because #dup gives us a new instance
|
13
18
|
Keka.err_if! old_val == record.public_send(attribute)
|
14
19
|
Keka.ok_if! record.valid?
|
15
20
|
Keka.err_if! true, record.errors.full_messages.join(', ')
|
data/lib/delay_henka/version.rb
CHANGED
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.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- zino
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|