Sha256: 9bf25b51e119c1a98a4ce4ec31ef5547125aa165cb590eb19ebd3307d8d251c0

Contents?: true

Size: 846 Bytes

Versions: 7

Compression:

Stored size: 846 Bytes

Contents

require 'rails/engine'

module Spree
  module Api
    class Engine < Rails::Engine
      isolate_namespace Spree
      engine_name 'spree_api'

      initializer 'spree.api.environment', before: :load_config_initializers do |_app|
        Spree::Api::Config = Spree::ApiConfiguration.new
        Spree::Api::Dependencies = Spree::ApiDependencies.new
      end

      initializer 'spree.api.checking_migrations' do
        Migrations.new(config, engine_name).check
      end

      initializer 'spree.api.checking_deprecated_preferences' do
        Spree::Api::Config.deprecated_preferences.each do |pref|
          warn "[DEPRECATION] Spree::Api::Config[:#{pref[:name]}] is deprecated. #{pref[:message]}"
        end
      end

      def self.root
        @root ||= Pathname.new(File.expand_path('../../..', __dir__))
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
spree_api-4.3.3 lib/spree/api/engine.rb
spree_api-4.3.2 lib/spree/api/engine.rb
spree_api-4.3.1 lib/spree/api/engine.rb
spree_api-4.3.0 lib/spree/api/engine.rb
spree_api-4.3.0.rc3 lib/spree/api/engine.rb
spree_api-4.3.0.rc2 lib/spree/api/engine.rb
spree_api-4.3.0.rc1 lib/spree/api/engine.rb