1
모델 : 컨트롤러에서검증 협회
class User
include MongoMapper::Document
many :properties
validates_associated :properties
...
end
class Property
include MongoMapper::Document
belongs_to :user
many :services
validates_associated :services
...
end
class Service
include MongoMapper::Document
belongs_to :property
...
end
:
@property.save #returns false and true as expected
current_user.save #returns always true why?
그것이 current_user.save 방법으로 속성 모델을 검증 나던 것으로 보인다. 왜? :(
간단한 테스트에서'validates_associated'는 임베디드 어소시에이션에서만 작동합니다. 나는 조사 중이며, 그 이유가 바로 코드에서 분명하지 않기 때문입니다. –