stateflow 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/lib/stateflow/persistence/mongoid.rb +4 -4
- data/stateflow.gemspec +2 -2
- metadata +3 -3
data/Rakefile
CHANGED
@@ -2,9 +2,9 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('stateflow', '0.1.
|
5
|
+
Echoe.new('stateflow', '0.1.1') do |p|
|
6
6
|
p.description = "State machine that allows dynamic transitions for business workflows"
|
7
|
-
p.url = "http://github.com/
|
7
|
+
p.url = "http://github.com/ryanza/stateflow"
|
8
8
|
p.author = "Ryan Oberholzer"
|
9
9
|
p.email = "ryan@platform45.com"
|
10
10
|
p.ignore_pattern = ["tmp/*", "script/*"]
|
@@ -2,10 +2,10 @@ module Stateflow
|
|
2
2
|
module Persistence
|
3
3
|
module Mongoid
|
4
4
|
def self.install(base)
|
5
|
-
base.respond_to?(:
|
5
|
+
base.respond_to?(:before_validate_on_create) ? base.before_validate_on_create(:ensure_initial_state) : base.before_validate(:ensure_initial_state, :on => :create)
|
6
6
|
base.send :include, InstanceMethods
|
7
7
|
end
|
8
|
-
|
8
|
+
|
9
9
|
module InstanceMethods
|
10
10
|
def load_from_persistence
|
11
11
|
self.send machine.state_column.to_sym
|
@@ -14,11 +14,11 @@ module Stateflow
|
|
14
14
|
def save_to_persistence(new_state)
|
15
15
|
self.update_attributes(machine.state_column.to_sym => new_state)
|
16
16
|
end
|
17
|
-
|
17
|
+
|
18
18
|
def ensure_initial_state
|
19
19
|
send("#{self.machine.state_column.to_s}=", self.current_state.name.to_s) if send(self.machine.state_column.to_s).blank?
|
20
20
|
end
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
24
|
-
end
|
24
|
+
end
|
data/stateflow.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{stateflow}
|
5
|
-
s.version = "0.1.
|
5
|
+
s.version = "0.1.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Ryan Oberholzer"]
|
9
|
-
s.date = %q{2010-05-
|
9
|
+
s.date = %q{2010-05-10}
|
10
10
|
s.description = %q{State machine that allows dynamic transitions for business workflows}
|
11
11
|
s.email = %q{ryan@platform45.com}
|
12
12
|
s.extra_rdoc_files = ["README.rdoc", "lib/stateflow.rb", "lib/stateflow/event.rb", "lib/stateflow/exception.rb", "lib/stateflow/machine.rb", "lib/stateflow/persistence.rb", "lib/stateflow/persistence/active_record.rb", "lib/stateflow/persistence/mongo_mapper.rb", "lib/stateflow/persistence/mongoid.rb", "lib/stateflow/persistence/none.rb", "lib/stateflow/state.rb", "lib/stateflow/transition.rb"]
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 1
|
8
|
-
-
|
9
|
-
version: 0.1.
|
8
|
+
- 1
|
9
|
+
version: 0.1.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Ryan Oberholzer
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2010-05-
|
17
|
+
date: 2010-05-10 00:00:00 +02:00
|
18
18
|
default_executable:
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|