On Wednesday, December 4, 2013 1:30:05 AM UTC-6, Nels Nelson wrote:
>
> undefined method `id' for {:one=>1}:Hash
>
I was able to work around this one as well, by changing
self.parent.remove_child self
to
self.parent.remove_children self.object_id
I'm guessing that the rcte_tree plugin uses 'child' as a special
depluralized keyword to reference the original children association. But
since I'm redefining the children association, the plugin thinks 'child'
refers to a singly-limited empty result set, which breaks.
Meanwhile this appears to work:
class Bar < Sequel::Model
plugin :rcte_tree
plugin :tactical_eager_loading
one_to_many :children, :key => :parent_id, :class => self, :eager =>
:foos
many_to_many :foos, :class => Foo, :join_table => :bar_to_foo,
:left_key => :foo_id, :right_key => :bar_id, :after_load => proc { |bar,
foos| foos.each { |foo| something_special_with(bar, foo) } }
end
However, it doesn't seem to provide any noticeable performance improvement.
I'll have to gather some metrics, and look into it further.
--
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.