On Tuesday, July 3, 2012 9:39:52 PM UTC-7, Nels Nelson wrote: > > Is there a hook that is executed while loading a model instance that is > selected from a Dataset? > > class Thing < Sequel::Model > def after_load > super > do_something_special > end > end >
You can override Model.call, Model#set_values, or Model#after_initialize, depending on the behavior you want. The after_initialize hook is called both for new model objects and objects loaded from the databases, but it's easy to use a ruby conditional if you only want the change made in one case or the other. 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/-/QAPFqi5VzGoJ. 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.
