2023-08-02 17:55:32 -07:00
|
|
|
require_relative "boot"
|
2010-05-14 15:12:31 -07:00
|
|
|
|
2023-11-11 15:12:41 -08:00
|
|
|
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
|
2024-09-20 13:14:00 -07:00
|
|
|
# - action_cable/engine
|
2023-11-11 15:12:41 -08:00
|
|
|
# - action_mailbox/engine
|
|
|
|
# - action_text/engine
|
|
|
|
%w(
|
|
|
|
active_record/railtie
|
|
|
|
action_controller/railtie
|
|
|
|
action_view/railtie
|
|
|
|
action_mailer/railtie
|
|
|
|
rails/test_unit/railtie
|
|
|
|
).each do |railtie|
|
|
|
|
begin
|
|
|
|
require railtie
|
|
|
|
rescue LoadError
|
|
|
|
end
|
|
|
|
end
|
2010-05-14 15:12:31 -07:00
|
|
|
|
2023-07-21 19:39:32 -07:00
|
|
|
# Require the gems listed in Gemfile, including any gems
|
2010-05-14 15:12:31 -07:00
|
|
|
# you've limited to :test, :development, or :production.
|
2023-07-21 19:39:32 -07:00
|
|
|
Bundler.require(*Rails.groups)
|
2010-05-14 15:12:31 -07:00
|
|
|
|
|
|
|
module OpenneoImpressItems
|
|
|
|
class Application < Rails::Application
|
2023-08-02 16:17:07 -07:00
|
|
|
# Initialize configuration defaults for originally generated Rails version.
|
2023-10-25 15:05:31 -07:00
|
|
|
config.load_defaults 7.1
|
2023-08-02 16:17:07 -07:00
|
|
|
|
2023-10-25 15:05:31 -07:00
|
|
|
# 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))
|
2010-05-14 15:12:31 -07:00
|
|
|
|
2023-10-25 15:05:31 -07:00
|
|
|
# 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.
|
|
|
|
#
|
Configure the application's default time zone to NST (US Pacific)
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!)
2024-06-18 16:39:37 -07:00
|
|
|
config.time_zone = "Pacific Time (US & Canada)"
|
2023-10-25 15:05:31 -07:00
|
|
|
# config.eager_load_paths << Rails.root.join("extras")
|
2010-05-14 15:12:31 -07:00
|
|
|
|
2024-09-13 20:55:09 -07:00
|
|
|
config.i18n.available_locales = [:en, :es, :pt, :"en-MEEP"]
|
|
|
|
config.i18n.default_locale = :en
|
2013-01-11 13:26:07 -08:00
|
|
|
config.i18n.fallbacks = true
|
2010-05-14 15:12:31 -07:00
|
|
|
|
2011-08-02 17:01:48 -07:00
|
|
|
Mime::Type.register "image/gif", :gif
|
2013-02-24 22:14:45 -08:00
|
|
|
|
|
|
|
ActionController::Base.config.relative_url_root = ''
|
2013-03-05 18:08:57 -08:00
|
|
|
|
|
|
|
config.assets.enabled = true
|
|
|
|
config.assets.version = '1.0'
|
2013-03-05 20:26:14 -08:00
|
|
|
config.assets.precompile << '*.js'
|
2013-03-05 19:52:31 -08:00
|
|
|
config.assets.initialize_on_precompile = false
|
2024-09-09 19:59:43 -07:00
|
|
|
config.assets.css_compressor = nil # Sass's compressor can't handle all modern CSS…
|
2013-07-02 14:10:01 -07:00
|
|
|
|
|
|
|
config.middleware.insert_after ActionDispatch::Flash, Rack::Attack
|
2024-01-15 01:15:35 -08:00
|
|
|
|
2024-01-23 21:47:51 -08:00
|
|
|
# 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
|
|
|
|
|
2024-01-15 01:15:35 -08:00
|
|
|
# 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"
|
2010-05-14 15:12:31 -07:00
|
|
|
end
|
|
|
|
end
|
2011-08-02 17:01:48 -07:00
|
|
|
|