mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-21 02:17:50 +01:00
added validation for Comment model
This commit is contained in:
parent
3a42ceafaf
commit
44cea60021
1 changed files with 2 additions and 0 deletions
|
@ -1,4 +1,6 @@
|
||||||
class Comment < ActiveRecord::Base
|
class Comment < ActiveRecord::Base
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :answer
|
belongs_to :answer
|
||||||
|
validates :user_id, presence: true
|
||||||
|
validates :answer_id, presence: true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue