Skip to content

Commit

Permalink
WEB-6569: I was just being silly, we need the title of a lesson.
Browse files Browse the repository at this point in the history
  • Loading branch information
jellodiil committed Oct 13, 2023
1 parent 5006f15 commit 2892266
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/lessons_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def check_unique_title(record, attribute, value)
lesson.segments.each { |segment| title_counts[segment.title] += 1 }
non_unique_titles = title_counts.select { |_, count| count > 1 }.keys

non_unique_titles.each { |title| record.errors.add(attribute, "(#{lesson}) segment title #{title} is not unique") }
non_unique_titles.each { |title| record.errors.add(attribute, "(#{lesson.title}) segment title #{title} is not unique") }
end
end
end

0 comments on commit 2892266

Please sign in to comment.