Sha256: 5125e7092be971419bb776711d6f1861ffe6a02702379efdb2a7dd7ce419b8c3

Contents?: true

Size: 719 Bytes

Versions: 4

Compression:

Stored size: 719 Bytes

Contents

# frozen_string_literal: true
class Coursemology::Polyglot::Engine < Rails::Engine
  def self.eager_load!
    super
    Coursemology::Polyglot.eager_load!
  end

  # :nocov:
  # These are Railties callbacks, which we can't trigger in specs specifically.
  def self.initialize_engine(_)
    Coursemology::Polyglot::Language.eager_load!
  end

  def self.after_initialize(_)
    return if !Coursemology::Polyglot::Language.connected? ||
              !Coursemology::Polyglot::Language.table_exists?

    Coursemology::Polyglot::Language.load_languages
  end
  # :nocov:

  initializer('coursemology.polyglot', &method(:initialize_engine))
  config.after_initialize(&method(:after_initialize))
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
coursemology-polyglot-0.2.2 lib/coursemology/polyglot/engine.rb
coursemology-polyglot-0.2.1 lib/coursemology/polyglot/engine.rb
coursemology-polyglot-0.2.0 lib/coursemology/polyglot/engine.rb
coursemology-polyglot-0.1.0 lib/coursemology/polyglot/engine.rb