We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0771c3b commit 957e840Copy full SHA for 957e840
app/models/website.rb
@@ -26,7 +26,7 @@ class Website < ApplicationRecord
26
DEFAULT = 'default'.freeze
27
28
def self.domain_match(domain)
29
- where(arel_table[:domains].matches("%#{(domain)}"))
+ where(arel_table[:domains].matches("%#{domain}%"))
30
end
31
32
def manual_purge
spec/models/website_spec.rb
@@ -11,6 +11,7 @@
11
rubyconf = create(:website, domains: 'www.rubyconf.org,www.rubyconf.com')
12
_otherconf = create(:website)
13
expect(Website.domain_match('rubyconf.com')).to contain_exactly(rubyconf)
14
+ expect(Website.domain_match('rubyconf.org')).to contain_exactly(rubyconf)
15
16
17
0 commit comments