Skip to content

Commit

Permalink
standardrb fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jlbyrne committed Feb 26, 2025
1 parent 897d4c4 commit b09e882
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/models/channel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -532,10 +532,10 @@ def validate_public_url_unique
if public_name_changed_at && public_name_changed_at > 60.days.ago
errors.add(:public_name, "public name change must be two months after previous change")
end

# Check if the value of public_name already exists in either column (case insensitive)
matches = self.class.where("LOWER(public_name) = :value OR LOWER(public_identifier) = :value", value: public_name.downcase)
if matches.exists? && !matches.pluck(:id).include?(self.id)
if matches.exists? && !matches.pluck(:id).include?(id)
errors.add(:public_name, "must be unique across both public_name and public_identifier")
end

Expand Down

0 comments on commit b09e882

Please sign in to comment.