Skip to content

Instantly share code, notes, and snippets.

@thoughtpunch
Created June 25, 2011 02:16
Show Gist options
  • Save thoughtpunch/1046031 to your computer and use it in GitHub Desktop.
Save thoughtpunch/1046031 to your computer and use it in GitHub Desktop.
config/database.rb
#config/database.rb
ActiveRecord::Base.configurations[:development] = {
:adapter => 'postgresql',
:host => 'localhost',
:port => '5432',
:database => 'trustmob_ui_development',
:username => 'postgres',
:password => ''
}
ActiveRecord::Base.configurations[:production] = {
:adapter => 'postgresql',
:host => 'localhost'
:database => 'trustmob_ui_production.db',
:username => 'postgres',
:password => ''
}
ActiveRecord::Base.configurations[:test] = {
:adapter => 'postgresql',
:host => 'localhost'
:database => 'trustmob_ui_test.db',
:username => 'postgres',
:password => ''
}
# Setup our logger
#ActiveRecord::Base.logger = logger
# Include Active Record class name as root for JSON serialized output.
ActiveRecord::Base.include_root_in_json = true
# Store the full class name (including module namespace) in STI type column.
ActiveRecord::Base.store_full_sti_class = true
# Use ISO 8601 format for JSON serialized times and dates.
ActiveSupport.use_standard_json_time_format = true
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
# if you're including raw json in an HTML page.
ActiveSupport.escape_html_entities_in_json = false
# Now we can estabilish connection with our db
ActiveRecord::Base.establish_connection(ActiveRecord::Base.configurations[Padrino.env])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment