scinote-web/app/models/project_comment.rb

8 lines
259 B
Ruby
Raw Normal View History

2016-02-12 23:52:43 +08:00
class ProjectComment < ActiveRecord::Base
validates :comment, :project, presence: true
validates :project_id, uniqueness: { scope: :comment_id }
belongs_to :comment, inverse_of: :project_comment
belongs_to :project, inverse_of: :project_comments
end