Merge commit '0d7340380cf3094335d8bc67f7c465e2b154566a' into glitch-soc/merge-upstream
Conflicts: - app/controllers/application_controller.rb: Upstream added an `include` where we had an extra `include` due to glitch-soc's theming system. Added upstream's new `include`.
This commit is contained in:
11
app/helpers/database_helper.rb
Normal file
11
app/helpers/database_helper.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module DatabaseHelper
|
||||
def with_read_replica(&block)
|
||||
ApplicationRecord.connected_to(role: :read, prevent_writes: true, &block)
|
||||
end
|
||||
|
||||
def with_primary(&block)
|
||||
ApplicationRecord.connected_to(role: :primary, &block)
|
||||
end
|
||||
end
|
@@ -2,7 +2,7 @@
|
||||
|
||||
module DomainControlHelper
|
||||
def domain_not_allowed?(uri_or_domain)
|
||||
return if uri_or_domain.blank?
|
||||
return false if uri_or_domain.blank?
|
||||
|
||||
domain = if uri_or_domain.include?('://')
|
||||
Addressable::URI.parse(uri_or_domain).host
|
||||
|
Reference in New Issue
Block a user