Sha256: 066a898c348077f7fe9c10639576c19ccc54832d8154474722cd01e052657bcc
Contents?: true
Size: 974 Bytes
Versions: 21
Compression:
Stored size: 974 Bytes
Contents
module CassandraObject class Railtie < Rails::Railtie rake_tasks do load 'cassandra_object/tasks/ks.rake' end initializer "cassandra_object.log_runtime" do |app| ActiveSupport.on_load :cassandra_object do pathname = Rails.root.join('config', 'cassandra.yml') if pathname.exist? config = YAML.load(pathname.read) if config = config[Rails.env] self.config = { keyspace: config['keyspace'], hosts: config['hosts'], } else raise "Missing environment #{Rails.env} in cassandra.yml" end end end end # Expose database runtime to controller for logging. initializer "cassandra_object.log_runtime" do |app| require "cassandra_object/railties/controller_runtime" ActiveSupport.on_load(:action_controller) do include CassandraObject::Railties::ControllerRuntime end end end end
Version data entries
21 entries across 21 versions & 1 rubygems