1
0
Fork 0
mirror of https://github.com/aasm/aasm synced 2023-03-27 23:22:41 -04:00

Added array option for new callbacks

This commit is contained in:
Scott Petersen 2009-02-27 17:41:46 -06:00
parent c96f0f38d4
commit 6e16196f20
5 changed files with 9 additions and 5 deletions

View file

@ -53,9 +53,9 @@ else
s.extra_rdoc_files = rd.rdoc_files.reject {|fn| fn =~ /\.rb$/}.to_a s.extra_rdoc_files = rd.rdoc_files.reject {|fn| fn =~ /\.rb$/}.to_a
s.rdoc_options = rd.options s.rdoc_options = rd.options
s.author = 'Scott Barron' s.authors = ['Scott Barron', 'Scott Petersen']
s.email = 'scott@elitists.net' s.email = 'petersen@dunedain289.com'
s.homepage = 'http://rubyi.st/aasm' s.homepage = 'http://github.com/dunedain289/aasm'
end end
package_task = Rake::GemPackageTask.new(spec) do |pkg| package_task = Rake::GemPackageTask.new(spec) do |pkg|

View file

@ -2,7 +2,7 @@ PKG_FILES = ["CHANGELOG", "MIT-LICENSE", "Rakefile", "README.rdoc", "TODO", "lib
Gem::Specification.new do |s| Gem::Specification.new do |s|
s.name = 'aasm' s.name = 'aasm'
s.version = "2.1" s.version = "2.1.1"
s.summary = 'State machine mixin for Ruby objects' s.summary = 'State machine mixin for Ruby objects'
s.description = <<-EOF s.description = <<-EOF
AASM is a continuation of the acts as state machine rails plugin, built for plain Ruby objects. AASM is a continuation of the acts as state machine rails plugin, built for plain Ruby objects.

View file

@ -5,7 +5,7 @@ require File.join(File.dirname(__FILE__), 'persistence')
module AASM module AASM
def self.Version def self.Version
'2.0.5' '2.1.1'
end end
class InvalidTransition < RuntimeError class InvalidTransition < RuntimeError

View file

@ -51,6 +51,8 @@ module AASM
record.send(action) record.send(action)
when Proc when Proc
action.call(record) action.call(record)
when Array
action.each { |a| record.send(a) }
end end
end end

View file

@ -22,6 +22,8 @@ module AASM
record.send(action) record.send(action)
when Proc when Proc
action.call(record) action.call(record)
when Array
action.each { |a| record.send(a) }
end end
end end