mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-20 22:41:25 +08:00
24dd25d9f5
Lessons learned during this fix: Don't use dependant: :destroy on both ends of association between 2 ActiveRecords, or you will run into stack overflow.
8 lines
257 B
Ruby
8 lines
257 B
Ruby
class ResultComment < ActiveRecord::Base
|
|
validates :result, :comment, presence: true
|
|
validates :result_id, uniqueness: { scope: :comment_id }
|
|
|
|
belongs_to :result, inverse_of: :result_comments
|
|
belongs_to :comment,
|
|
inverse_of: :result_comment
|
|
end
|