Sha256: 1df08f16d9380ef454628b132a2349ab7ac881f61d98a43e07b085a993bdd91f

Contents?: true

Size: 732 Bytes

Versions: 10

Compression:

Stored size: 732 Bytes

Contents

# Initialize Cassie instance with default behaviors for a Rails environment.
#
# Configuration will be gotten from config/cassie.yml.
#
# Schema location will be set to db/cassandra for development and test environments.
class Cassie::Railtie < Rails::Railtie
  initializer "cassie.initialization" do
    Cassie.logger = Rails.logger
    
    config_file = Rails.root + 'config' + 'cassie.yml'
    if config_file.exist?
      options = YAML::load(ERB.new(config_file.read).result)[Rails.env]
      if Rails.env.development? || Rails.env.test?
        schema_dir = Rails.root + 'db' + 'cassandra'
        options['schema_directory'] = schema_dir.to_s if schema_dir.exist?
      end
      Cassie.configure!(options)
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
whi-cassie-1.1.1 lib/cassie/railtie.rb
whi-cassie-1.1.0 lib/cassie/railtie.rb
whi-cassie-1.0.7 lib/cassie/railtie.rb
whi-cassie-1.0.6 lib/cassie/railtie.rb
whi-cassie-1.0.5 lib/cassie/railtie.rb
whi-cassie-1.0.4 lib/cassie/railtie.rb
whi-cassie-1.0.3 lib/cassie/railtie.rb
whi-cassie-1.0.2 lib/cassie/railtie.rb
whi-cassie-1.0.1 lib/cassie/railtie.rb
whi-cassie-1.0.0 lib/cassie/railtie.rb