require 'impartial/base' require 'impartial-rails/helper' module Impartial class Base protected def model(object_or_id, model_class) object_or_id.kind_of?(model_class) ? object_or_id : model_class.find(object_or_id.to_s) end def config return ::ActionController::Base.config end def url_options {} end def form_authenticity_token params[request_forgery_protection_token] end def protect_against_forgery? true end end end # Add to ActionController ActionController::Base.class_eval do include ::Impartial::Rails::Helper end # Add to ActionView ActionView::Base.class_eval do include ::Impartial::Rails::Helper end