Skip to content

Commit

Permalink
Merge pull request #227 from razeware/WEB-6569
Browse files Browse the repository at this point in the history
WEB-6569: Lesson title in linter
  • Loading branch information
jellodiil authored Oct 13, 2023
2 parents 5006f15 + 2892266 commit bcbeba6
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 bcbeba6

Please sign in to comment.