Sha256: 9a21d33f25f08e08cb21190fe1c3657c99a01e8e0f37bde25ea418a8bbd4d14f

Contents?: true

Size: 925 Bytes

Versions: 13

Compression:

Stored size: 925 Bytes

Contents

module Superstore
  class Railtie < Rails::Railtie
    rake_tasks do
      load 'superstore/tasks/ks.rake'
    end

    initializer "superstore.config" do |app|
      ActiveSupport.on_load :superstore do
        pathnames = [Rails.root.join('config', 'superstore.yml'), Rails.root.join('config', 'cassandra.yml')]
        if pathname = pathnames.detect(&:exist?)
          config = YAML.load(pathname.read)

          if config = config[Rails.env]
            self.config = config.symbolize_keys!
          else
            raise "Missing environment #{Rails.env} in superstore.yml"
          end
        end
      end
    end

    # Expose database runtime to controller for logging.
    initializer "superstore.log_runtime" do |app|
      require "superstore/railties/controller_runtime"
      ActiveSupport.on_load(:action_controller) do
        include Superstore::Railties::ControllerRuntime
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
superstore-1.1.1 lib/superstore/railtie.rb
superstore-1.1.0 lib/superstore/railtie.rb
superstore-1.0.12 lib/superstore/railtie.rb
superstore-1.0.11 lib/superstore/railtie.rb
superstore-1.0.10 lib/superstore/railtie.rb
superstore-1.0.9 lib/superstore/railtie.rb
superstore-1.0.8 lib/superstore/railtie.rb
superstore-1.0.7 lib/superstore/railtie.rb
superstore-1.0.6 lib/superstore/railtie.rb
superstore-1.0.5 lib/superstore/railtie.rb
superstore-1.0.4 lib/superstore/railtie.rb
superstore-1.0.3 lib/superstore/railtie.rb
superstore-1.0.2 lib/superstore/railtie.rb