From 1a9d4ac5a0a5fd0d459ff1986f9f05e617415b16 Mon Sep 17 00:00:00 2001 From: Valdis Pornieks Date: Tue, 30 May 2017 14:09:03 +0300 Subject: [PATCH] Rails 5 compatibility --- app/controllers/mercury_controller.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/app/controllers/mercury_controller.rb b/app/controllers/mercury_controller.rb index 447ccf9d..c97def4e 100644 --- a/app/controllers/mercury_controller.rb +++ b/app/controllers/mercury_controller.rb @@ -2,11 +2,19 @@ class MercuryController < ActionController::Base include ::Mercury::Authentication protect_from_forgery - before_filter :authenticate, :only => :edit layout false + if Rails::VERSION::MAJOR <= 4 + before_filter :authenticate, :only => :edit + else + before_action :authenticate, :only => :edit + end def edit - render :text => '', :layout => 'mercury' + if Rails::VERSION::MAJOR <= 4 + render :text => '', :layout => 'mercury' + else + render :layout => 'mercury' + end end def resource