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