This commit is contained in:
r888888888
2017-05-02 15:39:16 -07:00
parent a677efd572
commit 66458c34b0

View File

@@ -108,7 +108,13 @@ class Artist < ActiveRecord::Base
end
def domains
Post.raw_tag_match(name).pluck(:source).map {|x| map_domain(Addressable::URI.parse(x).domain)}.inject(Hash.new(0)) {|h, x| h[x] += 1; h}
Post.raw_tag_match(name).pluck(:source).map do |x|
begin
map_domain(Addressable::URI.parse(x).domain)
rescue Addressable::URI::InvalidURIError
nil
end
end.compact.inject(Hash.new(0)) {|h, x| h[x] += 1; h}
end
end