Sha256: f4d56d9432adb3d7b08f2c824f0085edc801a7a0e3725fe26ebd4030d06633b9

Contents?: true

Size: 656 Bytes

Versions: 1

Compression:

Stored size: 656 Bytes

Contents

module ActiveRecordViews
  class Railtie < ::Rails::Railtie
    initializer 'active_record_views' do |app|
      ActiveSupport.on_load :active_record do
        ActiveRecordViews.sql_load_path << Rails.root + 'app/models'
        ActiveRecordViews.init!
      end

      ActiveSupport.on_load :action_controller do
        ActiveRecordViews::Extension.create_enabled = !app.config.cache_classes
        unless app.config.cache_classes
          ActionDispatch::Callbacks.before do
            ActiveRecordViews.reload_stale_views!
          end
        end
      end
    end

    rake_tasks do
      load 'tasks/active_record_views.rake'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activerecord_views-0.0.18 lib/active_record_views/railtie.rb