scinote-web/app/models/step_comment.rb

8 lines
241 B
Ruby
Raw Normal View History

2016-02-12 23:52:43 +08:00
class StepComment < ActiveRecord::Base
validates :comment, :step, presence: true
validates :step_id, uniqueness: { scope: :comment_id }
belongs_to :comment, inverse_of: :step_comment
belongs_to :step, inverse_of: :step_comments
end