Move state for select logic into State
This commit is contained in:
parent
3ccbeaca88
commit
28fd460950
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue