mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-30 21:27:17 +00:00
For some reason running `bundle exec rake db:migrate RAILS_ENV=staging` fails with: ``` rake aborted! NameError: uninitialized constant Spree::Config ``` Running `bundle exec rails server` for instance, does not. There must be a difference on the way a rake task and the rails commands load the app. Moving this configuration to an initializer, at the end of the initialization process, fixes it. The constant `Spree::Config` is already loaded. **This is preventing the release v1.22.0 from being staged and tested**
7 lines
233 B
Ruby
7 lines
233 B
Ruby
ActionMailer::Base.configure do |config|
|
|
if Rails.env.production? || Rails.env.staging?
|
|
# Use https when creating links in emails
|
|
config.default_url_options = { protocol: 'https', host: Spree::Config[:site_url] }
|
|
end
|
|
end
|