I'm attempting to add a feature to Sequel that allows for controlling filtering, column selection, and ordering of eagerly loaded associations at runtime. I was having a hard time trying to construct the feature purely as a plugin and found I had to edit lib/sequel/ model/associations.rb. My question is whether or not my changes would be accepted upstream or if there's a more elegant/simpler way of accomplishing this.
The idea is to read association overrides from an option hash stored in a dataset. One of the missing pieces during the eager loading recursive process is context of the calling dataset. This diff shows how I pass the calling dataset through the various layers. http://pastie.org/private/evelijtq1kjgl8ij2lu0xg Then, from a plugin, I'm able to do this: http://pastie.org/private/5wgc5cqf04zs1zehkrrrq which allows for this: http://pastie.org/private/zfsagqp17kfrnknphvq0aw TIA, Mike -- You received this message because you are subscribed to the Google Groups "sequel-talk" group. 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.
