diff --git a/app/controllers/impressionist_controller.rb b/app/controllers/impressionist_controller.rb index 4e21621..2fee16a 100644 --- a/app/controllers/impressionist_controller.rb +++ b/app/controllers/impressionist_controller.rb @@ -3,13 +3,21 @@ require 'digest/sha2' module ImpressionistController module ClassMethods def impressionist(opts={}) - before_action { |c| c.impressionist_subapp_filter(opts) } + if Rails::VERSION::MAJOR >= 5 + before_action { |c| c.impressionist_subapp_filter(opts) } + else + before_filter { |c| c.impressionist_subapp_filter(opts) } + end end end module InstanceMethods def self.included(base) - base.before_action :impressionist_app_filter + if Rails::VERSION::MAJOR >= 5 + base.before_action :impressionist_app_filter + else + base.before_filter :impressionist_app_filter + end end def impressionist(obj,message=nil,opts={})