state_machines-activemodel 0.1.0 → 0.1.1

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: 267e4fb8f69329c31398b71ac32c02664b34885f
4
- data.tar.gz: 106659340f92fc1ef414cb862f8ab88840057461
3
+ metadata.gz: 9fedf5a156022db7fbe4b11be9b2433a207f62ce
4
+ data.tar.gz: 949c56beaa83869d7b69e61944d1aaf9a6fa60af
5
5
  SHA512:
6
- metadata.gz: 14e63bf17b1a6354e6f23fd381b365925e9f00d18ccbd1a00b5e172beb5d30c81ca1f3f03bec888c0d5ac568a7ca8f3228fbe0301cbce9233bd508dc6a5f80ea
7
- data.tar.gz: 4ef9b9cec076efb644a513df6ef42dbbfef102c0d14c16a3e0f1790b8f3df5fafb82a67a7458419ae95e77dbfe2a4ea92447434f7cdaa6867c7adeb0c08a86ce
6
+ metadata.gz: dd8da52261883a7a625f5b126c5816db04036f7a08ef40c0881f93aaa06341c93efeaf534f6919faba991792c9e3d6221a27e5d1a334a49c30a8fa751e483be0
7
+ data.tar.gz: 47c2e5f2cb54a748427d8d3b7a5f89eac3a4cfca40227a0eed3d641a5b11b6e9b294bc328ae95d471ce18501e6120994710bde64dbe5ece52af455c3ce110f27
@@ -402,6 +402,14 @@ module StateMachines
402
402
 
403
403
  protected
404
404
 
405
+ def define_state_initializer
406
+ define_helper :instance, <<-end_eval, __FILE__, __LINE__ + 1
407
+ def initialize(params = {})
408
+ self.class.state_machines.initialize_states(self, {}, params) { super }
409
+ end
410
+ end_eval
411
+ end
412
+
405
413
  # Whether validations are supported in the integration. Only true if
406
414
  # the ActiveModel feature is enabled on the owner class.
407
415
  def supports_validations?
@@ -1,7 +1,7 @@
1
1
  module StateMachines
2
2
  module Integrations
3
3
  module ActiveModel
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  end
6
6
  end
7
7
  end
@@ -23,7 +23,6 @@ class MachineWithFailedBeforeCallbacksTest < BaseTestCase
23
23
  end
24
24
 
25
25
  def test_should_not_change_current_state
26
- skip
27
26
  assert_equal 'parked', @record.state
28
27
  end
29
28
 
@@ -8,8 +8,6 @@ class MachineWithInitializedStateTest < BaseTestCase
8
8
  end
9
9
 
10
10
  def test_should_allow_nil_initial_state_when_static
11
- # FIXME
12
- skip
13
11
  @machine.state nil
14
12
 
15
13
  record = @model.new(state: nil)
@@ -25,8 +23,6 @@ class MachineWithInitializedStateTest < BaseTestCase
25
23
  end
26
24
 
27
25
  def test_should_allow_different_initial_state_when_static
28
- # FIXME
29
- skip
30
26
  record = @model.new(state: 'idling')
31
27
  assert_equal 'idling', record.state
32
28
  end
@@ -20,8 +20,6 @@ class MachineWithStateDrivenValidationsTest < BaseTestCase
20
20
  end
21
21
 
22
22
  def test_should_be_invalid_if_validation_fails_within_state_scope
23
- # FIXME
24
- skip
25
23
  record = @model.new(state: 'first_gear', seatbelt: nil)
26
24
  assert !record.valid?
27
25
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: state_machines-activemodel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Abdelkader Boudih
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-01-31 00:00:00.000000000 Z
12
+ date: 2015-02-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: state_machines