Skip to content

Commit

Permalink
Set rails application timezone to UTC
Browse files Browse the repository at this point in the history
Fixes #24
  • Loading branch information
atruskie committed Jul 27, 2020
1 parent 9817fce commit c0a734c
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions config/application.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('../boot', __FILE__)
require File.expand_path('boot', __dir__)

require 'English'
require 'rails/all'
Expand Down Expand Up @@ -52,8 +52,7 @@ class Application < Rails::Application
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'
#config.time_zone - 'UTC'
config.time_zone = 'Brisbane'
config.time_zone = 'UTC'

# config.active_record.default_timezone determines whether to use Time.local (if set to :local)
# or Time.utc (if set to :utc) when pulling dates and times from the database.
Expand All @@ -66,11 +65,10 @@ class Application < Rails::Application
config.i18n.available_locales = [:en]

# specify the class to handle exceptions
config.exceptions_app = ->(env) {
config.exceptions_app = lambda { |env|
ErrorsController.action(:uncaught_error).call(env)
}


Rails::Html::SafeListSanitizer.allowed_tags.merge(['table', 'tr', 'td', 'caption', 'thead', 'th', 'tfoot', 'tbody', 'colgroup'])

# middleware to rewrite angular urls
Expand All @@ -81,13 +79,13 @@ class Application < Rails::Application

# ensure you add url helpers in app/helpers/application_helper.rb

rewrite /^\/listen.*/i, '/listen_to/index.html'
rewrite /^\/birdwalks.*/i, '/listen_to/index.html'
rewrite /^\/library.*/i, '/listen_to/index.html'
rewrite /^\/demo.*/i, '/listen_to/index.html'
rewrite /^\/visualize.*/i, '/listen_to/index.html'
rewrite /^\/audio_analysis.*/i, '/listen_to/index.html'
rewrite /^\/citsci.*/i, '/listen_to/index.html'
rewrite(%r{^/listen.*}i, '/listen_to/index.html')
rewrite(%r{^/birdwalks.*}i, '/listen_to/index.html')
rewrite(%r{^/library.*}i, '/listen_to/index.html')
rewrite(%r{^/demo.*}i, '/listen_to/index.html')
rewrite(%r{^/visualize.*}i, '/listen_to/index.html')
rewrite(%r{^/audio_analysis.*}i, '/listen_to/index.html')
rewrite(%r{^/citsci.*}i, '/listen_to/index.html')
end

# Sanity check: test dependencies should not be loadable
Expand All @@ -96,7 +94,7 @@ def module_exists?(name, base = self.class)
base.const_defined?(name) && base.const_get(name).instance_of?(::Module)
end

test_deps = [ 'RSpec::Core::DSL', 'RSpec::Core::Version' ]
test_deps = ['RSpec::Core::DSL', 'RSpec::Core::Version']
first_successful_require = test_deps.find { |x| module_exists?(x) }
if first_successful_require
throw "Test dependencies available in non-test environment. `#{first_successful_require}` should not be a constant`"
Expand Down

0 comments on commit c0a734c

Please sign in to comment.