On Sunday, October 14, 2012 3:42:26 AM UTC-7, Marc Cooper wrote:
>
> Thanks for that.  Your trigger suggestions is something I'll think about.
>
> Actually, I'm doing the following at the moment:
>
> class Sequel::Model
>
>   def before_create
>     return false if super == false
>     now = Time.now.utc
>     self.updated_at = now
>     self.created_at = now
>   end
>
>   def before_update
>     return false if super == false
>     self.updated_at = Time.now.utc
>   end
>
> end
>
> Being part of Sequel::Model, I expected it to work on the join table, as 
> it does elsewhere.
>

The join table in a many-to-many association is not a model table.  If you 
want similar behavior, you'll have to use a model for the join table and 
one_to_many association to the join table model.

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/-/QKp7zVkiqyYJ.
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.

Reply via email to