Sha256: b57d05b328952fd759213e88e784cfe248d5ba7dacc938f5f8bcc8b24b885935

Contents?: true

Size: 840 Bytes

Versions: 10

Compression:

Stored size: 840 Bytes

Contents

module Xing

  class Engine < ::Rails::Engine
    isolate_namespace Xing

    config.autoload_paths += Dir[File.join(__FILE__, '../controllers/**/')]

    config.generators do |g|
      g.test_framework :rspec
    end

    # The ErrorConverter leverages (abuses?) the I18n mechanism to translate
    # ActiveModel validation errors into Xing JSON resource errors.  Here we
    # need to make sure the locales file for language 'json' is loaded for
    # I18n.
    initializer 'xing errors locales path' do
      I18n.load_path += Dir[File.join(File.dirname(__FILE__), '..', 'config', 'locales', '*.{rb,yml}')]
    end

    # Set the backend subdomain if it hasn't been configured by the user.
    initializer 'set subdomain' do
      Xing.configure do |xng_config|
        xng_config.backend_subdomain ||= 'api'
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
xing-backend-0.0.19 lib/xing/engine.rb
xing-backend-0.0.18 lib/xing/engine.rb
xing-backend-0.0.17 lib/xing/engine.rb
xing-backend-0.0.16 lib/xing/engine.rb
xing-backend-0.0.15 lib/xing/engine.rb
xing-backend-0.0.14 lib/xing/engine.rb
xing-backend-0.0.13 lib/xing/engine.rb
xing-backend-0.0.12 lib/xing/engine.rb
xing-backend-0.0.11 lib/xing/engine.rb
xing-backend-0.0.10 lib/xing/engine.rb