Move state for select logic into State

This commit is contained in:
Scott Barron 2008-05-31 15:11:18 -07:00
parent 3ccbeaca88
commit 28fd460950
2 changed files with 5 additions and 1 deletions

View File

@ -56,7 +56,7 @@ module AASM
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 File

@ -24,6 +24,10 @@ module AASM
action.call(record)
end
end
def for_select
[name.to_s.gsub(/_/, ' ').capitalize, name.to_s]
end
end
end
end