Sha256: 7755e6091b109155a21ade2b94c0c31cff3af03fa1515218a5e74c478631a230

Contents?: true

Size: 793 Bytes

Versions: 38

Compression:

Stored size: 793 Bytes

Contents

module Avromatic
  class Railtie < Rails::Railtie
    initializer 'avromatic.configure' do
      Avromatic.configure do |config|
        config.logger = Rails.logger
      end

      # Rails calls the to_prepare hook once during boot-up, after running
      # initializers. After the to_prepare call during boot-up, no code will
      # we reloaded, so we need to retain the contents of the nested_models
      # registry.
      #
      # For subsequent calls to to_prepare (in development), the nested_models
      # registry is cleared and repopulated by explicitly referencing the
      # eager_loaded_models.
      first_prepare = true

      Rails.configuration.to_prepare do
        Avromatic.prepare!(skip_clear: first_prepare)
        first_prepare = false
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
avromatic-1.0.0 lib/avromatic/railtie.rb
avromatic-0.33.0 lib/avromatic/railtie.rb
avromatic-0.32.0 lib/avromatic/railtie.rb
avromatic-0.32.0.rc0 lib/avromatic/railtie.rb
avromatic-0.31.0 lib/avromatic/railtie.rb
avromatic-0.30.0 lib/avromatic/railtie.rb
avromatic-0.29.1 lib/avromatic/railtie.rb
avromatic-0.29.0 lib/avromatic/railtie.rb
avromatic-0.28.1 lib/avromatic/railtie.rb
avromatic-0.27.0 lib/avromatic/railtie.rb
avromatic-0.26.0 lib/avromatic/railtie.rb
avromatic-0.25.0 lib/avromatic/railtie.rb
avromatic-0.24.0 lib/avromatic/railtie.rb
avromatic-0.23.0 lib/avromatic/railtie.rb
avromatic-0.22.0 lib/avromatic/railtie.rb
avromatic-0.21.1 lib/avromatic/railtie.rb
avromatic-0.21.0 lib/avromatic/railtie.rb
avromatic-0.21.0.rc1 lib/avromatic/railtie.rb
avromatic-0.21.0.rc0 lib/avromatic/railtie.rb
avromatic-0.20.0 lib/avromatic/railtie.rb