Skip to content

Instantly share code, notes, and snippets.

@readruby
Created March 3, 2009 01:21
Show Gist options
  • Select an option

  • Save readruby/73120 to your computer and use it in GitHub Desktop.

Select an option

Save readruby/73120 to your computer and use it in GitHub Desktop.
aasm/lib/state_transition.rb
# Source:
# http://github.com/rubyist/aasm/blob/baceb4b53e296cd45ac3acbd5df291e14b2993aa/lib/state_transition.rb
def perform(obj)
case @guard
when Symbol, String
obj.send(@guard)
when Proc
@guard.call(obj)
else
true
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment