acts_as_living 0.1.11 → 0.1.12
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 766149e13a944e10eae12248a3ae63eebf60bba40a479808402eb99ef209170f
|
4
|
+
data.tar.gz: fc87211523a5e977c8f2c2974984cbbaa5c5980a99960da54f5e253cefc9af14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 814e49cd0c1f5fb42d9039cc7da128bcc986c7e1594b1a89bdb59211b1c6e038cb313b6bf8773c7620892883cb9faf63c26740040cc7342decedcc3fc11a408e
|
7
|
+
data.tar.gz: 0b33966724c9b203df3823dfce69065b82b344601e1193893d1c27364c0d7f73bb6a09c6fdc6abef4ee4c79db9862d7a881b94f3ba4607d2df86d580af08ff2b
|
@@ -105,7 +105,7 @@ module ActsAsLiving::MethodsDefiner
|
|
105
105
|
end
|
106
106
|
|
107
107
|
def stage_keys
|
108
|
-
|
108
|
+
@stage_keys
|
109
109
|
end
|
110
110
|
|
111
111
|
def stages_after(stage)
|
@@ -144,7 +144,7 @@ module ActsAsLiving::MethodsDefiner
|
|
144
144
|
end
|
145
145
|
|
146
146
|
def newborn_stage
|
147
|
-
|
147
|
+
stage_keys.first
|
148
148
|
end
|
149
149
|
|
150
150
|
def death
|
@@ -156,11 +156,11 @@ module ActsAsLiving::MethodsDefiner
|
|
156
156
|
end
|
157
157
|
|
158
158
|
def phases_with_ranges
|
159
|
-
|
159
|
+
phases.map(&method(:to_phase_with_range)).to_h
|
160
160
|
end
|
161
161
|
|
162
162
|
def to_phase_with_range(phase, delimiter)
|
163
|
-
[phase, (
|
163
|
+
[phase, (stages_enum[delimiter.first]..stages_enum[delimiter.last])]
|
164
164
|
end
|
165
165
|
|
166
166
|
def phases
|
@@ -1,7 +1,7 @@
|
|
1
1
|
module ActsAsLiving::ScopesDefiner
|
2
2
|
def self.call(klass)
|
3
3
|
klass.class_eval do
|
4
|
-
|
4
|
+
stage_keys.each do |stage|
|
5
5
|
scope "past_#{stage}", -> { where('stage >= ?', stages_enum[stage]) }
|
6
6
|
scope "pre_#{stage}", -> { where('stage < ?', stages_enum[stage]) }
|
7
7
|
end
|