Skip to content

Commit

Permalink
Use State objects
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Barron committed May 31, 2008
1 parent 30a8d15 commit d3c49b6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/aasm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def aasm_initial_state=(state)
end

def aasm_state(name, options={})
aasm_states << name unless aasm_states.include?(name)
aasm_states << AASM::SupportingClasses::State.new(name, options) unless aasm_states.include?(name)
self.aasm_initial_state = name unless self.aasm_initial_state

define_method("#{name.to_s}?") do
Expand Down Expand Up @@ -88,7 +88,7 @@ def aasm_events
end

def aasm_states_for_select
aasm_states.collect { |state| [state.to_s.gsub(/_/, ' ').capitalize, state.to_s] }
aasm_states.collect { |state| [state.name.to_s.gsub(/_/, ' ').capitalize, state.name.to_s] }
end

end
Expand Down

0 comments on commit d3c49b6

Please sign in to comment.