Sha256: 02c1b0cc0a8a9de855271bfa70bc53eb83c3243d84f65f1e7bbea4c14710a8c8

Contents?: true

Size: 607 Bytes

Versions: 10

Compression:

Stored size: 607 Bytes

Contents

class Usable::Railtie < Rails::Railtie
  config.usable_config = Struct.new(:frozen).new(false)

  # This was the only way to consistently hook into the end of the Rails eager load process. The +after_initialize+ hook works great, except when
  # +Rails.application.eager_load!+ is called directly from a third-party gem (e.g. Resque rake task), in which case the order is not guaranteed.
  # The solution instead is to overload +eager_load!+
  initializer 'usable' do |app|
    if app.config.usable_config.frozen
      require 'usable/eager_load'
      app.class.prepend Usable::EagerLoad
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
usable-3.10.0 lib/usable/railtie.rb
usable-3.9.4 lib/usable/railtie.rb
usable-3.9.3 lib/usable/railtie.rb
usable-3.9.2 lib/usable/railtie.rb
usable-3.9.1 lib/usable/railtie.rb
usable-3.9.0 lib/usable/railtie.rb
usable-3.8.0 lib/usable/railtie.rb
usable-3.7.1 lib/usable/railtie.rb
usable-3.7.0 lib/usable/railtie.rb
usable-3.6.2 lib/usable/railtie.rb