On Saturday, March 24, 2012 1:06:21 AM UTC-7, Jamie Hodge wrote: > > How would approach validations, ie requiring at least on such > association? Would you create an accessor for a count or the like and > validate that?
In the assocation_pks case, I'm not sure what sort of validation you want to use, as you don't have any associated objects. However, you can use after_validation_hook to add extra validations on a per-instance basis. Take a look at how the nested_attributes plugin is implemented, as it uses instance_hooks and handles validations for associated objects. Jeremy -- 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/-/HCkZHW7m9QwJ. 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.
