Sha256: 4fe3f92bf8bbcf0aa003ad3274ae222229c09d48682da189b39005f9b50b8a54

Contents?: true

Size: 1.15 KB

Versions: 1

Compression:

Stored size: 1.15 KB

Contents

module Tuning
  class Railtie < Rails::Railtie

    initializer 'tuning.active_model' do
      ::ActiveModel::Model.include(
        Tuning::Validations
      )
    end

    initializer 'tuning.active_record' do
      ActiveSupport.on_load :active_record do
        ::ActiveRecord::Base.include(
          Tuning::Extensions::ActiveRecord::Base,
          Tuning::Validations
        )
      end
    end

    initializer 'tuning.action_mailer' do
      ActiveSupport.on_load :action_mailer do
        ::ActionMailer::Base.include(
          Tuning::Extensions::ActionMailer::Base
        )
      end
    end

    initializer 'tuning.action_view' do
      ActiveSupport.on_load :action_view do
        ::ActionView::Base.include(
          Tuning::Extensions::ActionView::Base
        )
        ::ActionView::Template::Handlers.include(
          Tuning::Extensions::ActionView::Handlers
        )
        ::ActionView::Template.register_template_handler(
          :ruby,
          ::ActionView::Template::Handlers::Ruby.new
        )
      end
    end

    initializer 'tuning.i18n' do
      I18n.load_path += Dir[File.expand_path('../locales/*.yml', __FILE__)]
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tuning-5.1.3 lib/tuning/railtie.rb