mirror of
https://github.com/internetee/registry.git
synced 2025-08-05 09:21:43 +02:00
Story#107279016 - admin shows all reserved domains line by line
This commit is contained in:
parent
13c3d2092f
commit
3bb6150c1f
2 changed files with 32 additions and 6 deletions
|
@ -9,7 +9,15 @@ class ReservedDomain < ActiveRecord::Base
|
|||
|
||||
class << self
|
||||
def pw_for(domain_name)
|
||||
select("names -> '#{domain_name}' AS pw").first.try(:pw)
|
||||
by_domain(domain_name).select("names -> '#{domain_name}' AS pw").first.try(:pw)
|
||||
end
|
||||
|
||||
def by_domain name
|
||||
where("names ? '#{name}'")
|
||||
end
|
||||
|
||||
def any_of_domains names
|
||||
where("names ?| ARRAY['#{names.join("','")}']")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue