Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def complete_current_orders
- succeeded = true
- @company = Company.find(params[:company_id])
- @orders = @company.orders.all(:conditions => ["status = ? AND ready_for_confirm = ?", "draft", true])
- if @company.combine_orders?
- Order.combine_all
- end
- @orders.each do |o|
- succeeded = o.update_attribute('status', 'confirmed_by_company') if !o.order_items.empty?
- end
- if succeeded
- flash[:notice] = "Beställningen har mottagits."
- redirect_to overview_url
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement