Hello. I am going to store association created/updated dates.

class A
  # any association with join table
  many_to_many :bs, :join_table => :a_with_bs
end
class B
  many_to_many :as, :join_table => :a_with_bs
end
class AWithB
  plugin :timestamps
end

a.add_b b

It will just insert foreign keys
INSERT into a_with_bs (a_id, b_id) ...

I've found a method *def_many_to_many* in *model/associations.rb*. It uses:

def _join_table_dataset(opts)
  ds = model.db.from(opts.join_table_source)
  opts[:join_table_block] ? opts[:join_table_block].call(ds) : ds
end

It is not able to call *before_update* or *before_validation* of AWithB. Do 
you plan to support timestamps in join table model? Now we can use 
postgresql triggers instead. Thank you.

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sequel-talk+unsubscr...@googlegroups.com.
To post to this group, send email to sequel-talk@googlegroups.com.
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to