Skip to content

Commit

Permalink
Remove unnecessary Unique validation RuboCop TODO
Browse files Browse the repository at this point in the history
They probably got unnecessary due to the update of RuboCop, though I
haven't looked into their changelog to confirm.
  • Loading branch information
Splines committed Apr 17, 2024
1 parent 9bed3a5 commit 456239f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/notion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Notion < ApplicationRecord
belongs_to :tag, optional: true, touch: true
belongs_to :aliased_tag, class_name: "Tag", optional: true, touch: true

validates :title, uniqueness: { scope: :locale } # rubocop:todo Rails/UniqueValidationWithoutIndex
validates :title, uniqueness: { scope: :locale }
validates :title, presence: true
validate :presence_of_tag, if: :persisted?

Expand Down
2 changes: 1 addition & 1 deletion app/models/term.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class Term < ApplicationRecord
has_many :lectures

# season can only be SS/WS, and there can be only one of this type each year
validates :season, presence: true, # rubocop:todo Rails/UniqueValidationWithoutIndex
validates :season, presence: true,
inclusion: { in: ["SS", "WS"] },
uniqueness: { scope: :year }
# a year >=2000 needs to be present
Expand Down

0 comments on commit 456239f

Please sign in to comment.