Skip to content

Commit

Permalink
モデルの冗長なpresenceの定義を削除
Browse files Browse the repository at this point in the history
  • Loading branch information
kuri0616 committed Nov 16, 2024
1 parent 9e1965f commit 9a4c051
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion backend/app/models/comment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#
class Comment < ApplicationRecord
validates :content, presence: true, length: { maximum: 1024 }
validates :poster, presence: true, length: { maximum: 50 }
validates :poster, length: { maximum: 50 }
belongs_to :memo
belongs_to :poster
end
2 changes: 1 addition & 1 deletion backend/app/models/memo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
class Memo < ApplicationRecord
validates :title, presence: true
validates :content, presence: true
validates :poster, presence: true, length: { maximum: 50 }
validates :poster, length: { maximum: 50 }
belongs_to :poster
has_many :comments, dependent: :destroy
has_many :memo_tags, dependent: :destroy
Expand Down

0 comments on commit 9a4c051

Please sign in to comment.