ruby一些类加载方式

阅读更多
require_dependency 'order/scopes'


RailsLog::ControllerSubscriber.attach_to :action_controller
RailsLog::MailerSubscriber.attach_to :action_mailer


helper_method :current_contact, :current_cart_items, :current_currency


require 'active_support/configurable'
module RailsLog
  include ActiveSupport::Configurable

  configure do |config|
    config.ignore_exception = [
      'ActionController::UnknownFormat'
    ]
    config.constraint = -> (req){ User.find_by(id: req.env['rack.session']['user_id'])&.admin? }
  end

end

你可能感兴趣的:(ruby一些类加载方式)