Skip to content

Commit

Permalink
Share logging object with ActiveRecord [#69 state:resolved responsibl…
Browse files Browse the repository at this point in the history
…e:bklang milestone:"0.8.5"]
  • Loading branch information
bklang committed Jun 26, 2010
1 parent ed3361c commit e6880ea
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app_generators/ahn/templates/config/startup.rb
Expand Up @@ -44,6 +44,8 @@

# Configure a database to use ActiveRecord-backed models. See ActiveRecord::Base.establish_connection
# for the appropriate settings here.
# You can also override the default log destination by supplying an alternate
# logging object with :logger. The default is ahn_log.db.
# config.enable_database :adapter => 'mysql',
# :username => 'joe',
# :password => 'secret',
Expand Down
4 changes: 4 additions & 0 deletions lib/adhearsion/initializer/database.rb
Expand Up @@ -14,6 +14,10 @@ def start
# You may need to uncomment the following line for older versions of ActiveRecord
# ActiveRecord::Base.allow_concurrency = true
establish_connection
ActiveRecord::Base.logger =
@@config.connection_options.has_key?(:logger) ?
@@config.connection_options[:logger] :
ahn_log.db
create_call_hook_for_connection_cleanup
end

Expand Down

0 comments on commit e6880ea

Please sign in to comment.