-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdatabase.rb
30 lines (21 loc) · 1.06 KB
/
database.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Setup our logger
ActiveRecord::Base.logger = logger
if ActiveRecord::VERSION::MAJOR.to_i < 4
# Raise exception on mass assignment protection for Active Record models.
ActiveRecord::Base.mass_assignment_sanitizer = :strict
# Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL).
ActiveRecord::Base.auto_explain_threshold_in_seconds = 0.5
end
# Doesn't include Active Record class name as root for JSON serialized output.
ActiveRecord::Base.include_root_in_json = false
# 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
ActiveRecord::Base.establish_connection(ENV['DATABASE_URL'])
# Timestamps are in the utc by default.
ActiveRecord::Base.default_timezone = :utc