forked from OpenNeo/impress
Matchu
a9f44c0aa6
This doesn't affect a lot right now, it was previously defaulting to UTC I think? And I've confirmed that, while timestamps are stored in the database as UTC, they're not interpreted any differently with this setting. (Or, rather, it's loaded as a `DateTime` object for the same moment in time, but in the NST time zone. Good!) But this feels like a more useful default for displaying things for development etc, and moreover, I'm working on some logic for things like "when do limited-time Dyeworks items expire exactly?", and that logic is made *much* simpler if we can just compare dates in NST by default rather than fudge around with the zones on them and figuring out the correct midnight! (Although, as I type this, I think I maybe have thought of an easier way to do it? So maybe this change won't actually be necessary for that, but it still feels like a more sensible default for us regardless!)
75 lines
2.4 KiB
Ruby
75 lines
2.4 KiB
Ruby
require_relative "boot"
|
|
|
|
require "rails"
|
|
|
|
# We disable some components we don't use, to: omit their routes, be confident
|
|
# that there's not e.g. surprise storage happening on the machine, and keep the
|
|
# app footprint smaller.
|
|
#
|
|
# Disabled:
|
|
# - active_storage/engine
|
|
# - active_job/railtie
|
|
# - action_mailbox/engine
|
|
# - action_text/engine
|
|
%w(
|
|
active_record/railtie
|
|
action_cable/engine
|
|
action_controller/railtie
|
|
action_view/railtie
|
|
action_mailer/railtie
|
|
rails/test_unit/railtie
|
|
).each do |railtie|
|
|
begin
|
|
require railtie
|
|
rescue LoadError
|
|
end
|
|
end
|
|
|
|
# Require the gems listed in Gemfile, including any gems
|
|
# you've limited to :test, :development, or :production.
|
|
Bundler.require(*Rails.groups)
|
|
|
|
module OpenneoImpressItems
|
|
class Application < Rails::Application
|
|
# Initialize configuration defaults for originally generated Rails version.
|
|
config.load_defaults 7.1
|
|
|
|
# Please, add to the `ignore` list any other `lib` subdirectories that do
|
|
# not contain `.rb` files, or that should not be reloaded or eager loaded.
|
|
# Common ones are `templates`, `generators`, or `middleware`, for example.
|
|
config.autoload_lib(ignore: %w(assets tasks))
|
|
|
|
# Configuration for the application, engines, and railties goes here.
|
|
#
|
|
# These settings can be overridden in specific environments using the files
|
|
# in config/environments, which are processed later.
|
|
#
|
|
config.time_zone = "Pacific Time (US & Canada)"
|
|
# config.eager_load_paths << Rails.root.join("extras")
|
|
|
|
config.i18n.fallbacks = true
|
|
|
|
Mime::Type.register "image/gif", :gif
|
|
|
|
ActionController::Base.config.relative_url_root = ''
|
|
|
|
config.assets.enabled = true
|
|
config.assets.version = '1.0'
|
|
config.assets.paths << Rails.root.join('app', 'assets', 'fonts')
|
|
config.assets.precompile << '*.js'
|
|
config.assets.initialize_on_precompile = false
|
|
|
|
config.middleware.insert_after ActionDispatch::Flash, Rack::Attack
|
|
|
|
# On the Falcon server, requests run on fibers. Isolate Rails internal
|
|
# state to the per-fiber level, to avoid conflicts that crash stuff!
|
|
config.active_support.isolation_level = :fiber
|
|
|
|
# It seems like some Neopets servers reject any user agent containing
|
|
# symbols? So I can't provide anything helpful like a URL, email address,
|
|
# version number, etc. So let's only send this to Neopets systems, where it
|
|
# should hopefully be clear who we are from context!
|
|
config.user_agent_for_neopets = "Dress to Impress"
|
|
end
|
|
end
|
|
|