one_to_one :some_association,
  class: "SomeAssociation",
  graph_block: (proc do |j|
    byebug
    {Sequel[j][:user_id] => current_user.id}
  end) do |ds|
  byebug
  ds.where(user_id: ds.model.current_user.id)
end




I was calling 

models = Model.all 

models.first.some_association

I noticed that sometimes that second block (:block option) was not getting 
triggered, but the sequel would run with conditions cached on previous runs?

Is there any kind of caching that might be happening with the resulting 
conditions from the block passed into one_to_one?

The current_user.id is being cached from previous calls and the block is 
not getting run on a per call basis.

Anyway to override that?


Aryk


-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sequel-talk/5f5e9b54-0deb-4166-8d31-29fd7a3b9965o%40googlegroups.com.

Reply via email to