Improve various queries against account domains (#25126)
This commit is contained in:
1 parent
e58c36d308
commit
1d588d58f1
7 files changed
+42
-3
No files matched your search
@@ -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