Skip to content

Commit

Permalink
Adds custom errors for current queens award
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDancingClown committed Aug 8, 2023
1 parent 237335e commit 0bf0f2d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/value_objects/current_queens_award.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ class CurrentQueensAward

attr_reader :categories, :years, :category, :year, :outcome, :outcomes

validates :category, :year, :outcome, presence: true
validates :category, presence: { message: "Category is required and an option must be selected from the following list" }
validates :year, presence: { message: "Year is required and an option must be selected from the following list" }
validates :outcome, presence: { message: "Outcome is required and an option must be selected from the following list"}

validates :category, length: { maximum: 100 },
inclusion: {
Expand Down

0 comments on commit 0bf0f2d

Please sign in to comment.