Permalink
Browse files

Move state for select logic into State

  • Loading branch information...
1 parent 3ccbeac commit 28fd46095039cd777cf7fd75b9aa328144ca66b8 Scott Barron committed May 31, 2008
Showing with 5 additions and 1 deletion.
  1. +1 −1 lib/aasm.rb
  2. +4 −0 lib/state.rb
View
@@ -56,7 +56,7 @@ def aasm_events
end
def aasm_states_for_select
- aasm_states.collect { |state| [state.name.to_s.gsub(/_/, ' ').capitalize, state.name.to_s] }
+ aasm_states.map { |state| state.for_select }
end
end
View
@@ -24,6 +24,10 @@ def call_action(action, record)
action.call(record)
end
end
+
+ def for_select
+ [name.to_s.gsub(/_/, ' ').capitalize, name.to_s]
+ end
end
end
end

0 comments on commit 28fd460

Please sign in to comment.