make settle directly less dangerous
(closes foodcoops#275)
This commit is contained in:
parent
ea8e4ee560
commit
852f3484ad
5 changed files with 18 additions and 12 deletions
|
|
@ -224,6 +224,7 @@ class Order < ActiveRecord::Base
|
|||
# Close the order directly, without automaticly updating ordergroups account balances
|
||||
def close_direct!(user)
|
||||
raise I18n.t('orders.model.error_closed') if closed?
|
||||
comments.create(user: user, text: I18n.t('orders.model.close_direct_message'))
|
||||
update_attributes! state: 'closed', updated_by: user
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue