Improve various queries against account domains (#25126)
This commit is contained in:
@@ -22,6 +22,7 @@ class Instance < ApplicationRecord
|
||||
end
|
||||
|
||||
scope :matches_domain, ->(value) { where(arel_table[:domain].matches("%#{value}%")) }
|
||||
scope :by_domain_and_subdomain, ->(domain) { where("reverse('.' || domain) LIKE reverse(?)", "%.#{domain}") }
|
||||
|
||||
def self.refresh
|
||||
Scenic.database.refresh_materialized_view(table_name, concurrently: true, cascade: false)
|
||||
|
Reference in New Issue
Block a user