Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
gradeが空入力でも問題ないように修正.
Browse files Browse the repository at this point in the history
  • Loading branch information
tanakaryo341 authored and MIZOGUCHIKoki committed Jan 27, 2024
1 parent de4bedd commit 3c22aed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/score.rb
Expand Up @@ -7,7 +7,7 @@ class Score < ApplicationRecord
validates :composer, length: { maximum: 255 }
validates :arranger, length: { maximum: 255 }
# 最長でなく、数値の最大が5
validates :grade, allow_nil: true,
validates :grade, allow_blank: true,
numericality: { greater_than_or_equal_to: 0, less_than_or_equal_to: 5 }
validates :m_time, allow_nil: true,
numericality: { only_integer: true, greater_than_or_equal_to: 0, less_than_or_equal_to: 1800 }
Expand Down

0 comments on commit 3c22aed

Please sign in to comment.