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? unless @ordergroup.nil?
@ordergroup = Ordergroup.include_transaction_class_sum.find(@ordergroup) @ordergroup = Ordergroup.include_transaction_class_sum.find(@ordergroup.id)
if params['sort'] if params['sort']
sort = case params['sort'] sort = case params['sort']

View file

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

View file

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

View file

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