开发者

rails, how to validate that an associated record exists before saving?

开发者 https://www.devze.com 2023-03-11 19:35 出处:网络
I have the following mod开发者_运维技巧els: Groups, and then GroupMembers. I don\'t want a group to be allowed to be saved there is at least one groupmember model associated via a build.

I have the following mod开发者_运维技巧els:

Groups, and then GroupMembers.

I don't want a group to be allowed to be saved there is at least one groupmember model associated via a build.

how can I do that in the model? Thanks


See rails has_many minimum collection size update validation

0

精彩评论

暂无评论...
验证码 换一张
取 消