I have a parent model, Product, that has many Variants. I'm using nested_attributes on the Product model. On the Variants model I have a presence validation on the :product. When I try to persist the product with some :variants_attributes, I get a validation error saying:
gems/sequel-3.36.1/lib/sequel/model/base.rb:1228:in `save': variants product is not present (Sequel::ValidationFailed) If I remove that validation, the product_id gets set correctly in the Variant table. Do I have to manually set the product_id somewhere so that the validation can pass? It seems like the id is set on save, so the validation fails because valid? is called before save. -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. To view this discussion on the web visit https://groups.google.com/d/msg/sequel-talk/-/wm3Ueg8CO7IJ. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sequel-talk?hl=en.
