mirror of
https://github.com/aasm/aasm
synced 2023-03-27 23:22:41 -04:00
Corrected aasm_states_for_select to return state as string for option value.
This commit is contained in:
parent
fc86784602
commit
34444b7632
2 changed files with 3 additions and 3 deletions
|
@ -88,7 +88,7 @@ module AASM
|
|||
end
|
||||
|
||||
def aasm_states_for_select
|
||||
aasm_states.collect { |state| [state.to_s.gsub(/_/, ' ').capitalize, state] }
|
||||
aasm_states.collect { |state| [state.to_s.gsub(/_/, ' ').capitalize, state.to_s] }
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -58,8 +58,8 @@ end
|
|||
|
||||
|
||||
describe AASM, '- aasm_states_for_select' do
|
||||
it "should return a select friendly array of states in the form of [['Friendly name', :state_name]]" do
|
||||
Foo.aasm_states_for_select.should == [['Open', :open], ['Closed', :closed]]
|
||||
it "should return a select friendly array of states in the form of [['Friendly name', 'state_name']]" do
|
||||
Foo.aasm_states_for_select.should == [['Open', 'open'], ['Closed', 'closed']]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue