Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/initializers/mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ def email_address_with_name(address, name)
end.to_s
end

if ActiveRecord::Base.connection.table_exists?(Setting.table_name)
if ActiveRecord::Base.connection.data_source_exists?(Setting.table_name)
email_setting = Setting.find_by_key("system/mailer/email")
ActionMailer::Base.smtp_settings[:user_name] = email_setting&.value
ActionMailer::Base.smtp_settings[:password] = Setting.find_by_key("system/mailer/password")&.value
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/secret_token.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# if a setting is stored in database, use that secret token instead (because that token is not checked in to the git repository)
# only appears to affect cookie stored sessions (no apparent effect on database stored sessions)
if ActiveRecord::Base.connection.table_exists?(Setting.table_name) && Setting.exists?(key: "sessions/secret_token")
if ActiveRecord::Base.connection.data_source_exists?(Setting.table_name) && Setting.exists?(key: "sessions/secret_token")
token = Setting.find_by_key("sessions/secret_token").value
NZTrain::Application.config.secret_token = token if token && !token.empty?
end
Expand Down
2 changes: 1 addition & 1 deletion config/initializers/sentry.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Sentry.init do |config|
# TODO: Migrate to the env var SENTRY_DSN or to secrets once we have a good method for managing these
if ActiveRecord::Base.connection.table_exists?(Setting.table_name) && Setting.exists?(key: "sentry_dsn")
if ActiveRecord::Base.connection.data_source_exists?(Setting.table_name) && Setting.exists?(key: "sentry_dsn")
dsn = Setting.find_by_key("sentry_dsn")&.value
config.dsn = dsn if dsn.present?
end
Expand Down