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: 3e87290cedea511a2ba4b8cab31230571fdb44a028f467b7977a23fd5bed077b
4
- data.tar.gz: 39ca800b0d746cdcf75a5351841e93df6dc9e1172ac920366921584422d05e62
3
+ metadata.gz: 766149e13a944e10eae12248a3ae63eebf60bba40a479808402eb99ef209170f
4
+ data.tar.gz: fc87211523a5e977c8f2c2974984cbbaa5c5980a99960da54f5e253cefc9af14
5
5
  SHA512:
6
- metadata.gz: f25c46c79d4a0f7072061260a60676c6a513fd0661052425eb56569bac1d422975c725e91691b11ea3854ec4b3345ebd0d25f7758ece6737b844c809ea7a6741
7
- data.tar.gz: 98980a7c434376bb0b28868dac1d77731030347024a9d46844554d217b7fa5e89d5f49e5c6078bd6025d4aa2dbfe0107689dd9f9c3f15ee734de95da73aa9476
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
- stages.keys
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
- stages.key(0)
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
- @phases.map(&method(:to_phase_with_range)).to_h
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, (stages[delimiter.first]..stages[delimiter.last])]
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
- stages.each do |stage,|
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
@@ -1,3 +1,3 @@
1
1
  module ActsAsLiving
2
- VERSION = "0.1.11"
2
+ VERSION = "0.1.12"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acts_as_living
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Guilherme Andrade