0
또 다른 question에 속성에 대한 질문이 있지만 연관성을 높이고 싶습니다. 레일스 ActiveRecord : 레코드가 특정 상태로 들어갈 때 특정 연결 잠그기
내가 간단한 블로깅 모델class Discussion < ActiveRecord::Base
has_many :comments
end
class Comment < ActiveRecord::Base
belongs_to :discussion
end
토론은이 #closed있다 말해봐? 부울 상태. 나는 을 (를) 모두에 등록하고 있습니다. 닫힌 토론에 더 많은 의견을 남기십시오. 예를 들어,
discussion.comments << Comment.new
discussion.comments.create(:text => 'Something')
하고있을 수있는 다른 사람 ...
감사합니다,
- 제이슨