Various small rails 5 adoptions

This commit is contained in:
Patrick Gansterer 2020-08-12 13:38:18 +02:00
parent 3a6276aece
commit 266e9337be
4 changed files with 5 additions and 5 deletions

View File

@ -40,7 +40,7 @@ class HomeController < ApplicationController
unless @ordergroup.nil?
@ordergroup = Ordergroup.include_transaction_class_sum.find(@ordergroup)
@ordergroup = Ordergroup.include_transaction_class_sum.find(@ordergroup.id)
if params['sort']
sort = case params['sort']

View File

@ -94,7 +94,7 @@ class OrdersController < ApplicationController
# Update an existing order.
def update
@order = Order.find params[:id]
if @order.update_attributes params[:order]
if @order.update_attributes params[:order].merge(updated_by: current_user)
flash[:notice] = I18n.t('orders.update.notice')
redirect_to :action => 'show', :id => @order
else

View File

@ -9,10 +9,10 @@ class StylesController < ApplicationController
def foodcoop
css = FoodsoftConfig[:custom_css]
if css.blank?
render text: nil, content_type: 'text/css', status: 404
render body: nil, content_type: 'text/css', status: 404
else
expires_in 1.week, public:true if params[:md5].present?
render text: css, content_type: 'text/css'
render body: css, content_type: 'text/css'
end
end
end

View File

@ -1,5 +1,5 @@
class PollsController < ApplicationController
before_filter -> { require_plugin_enabled FoodsoftPolls }
before_action -> { require_plugin_enabled FoodsoftPolls }
def index
@polls = Poll.page(params[:page]).per(@per_page).order(created_at: :desc)