> I gave this some more thought and think that instead of providing a
> dataset, you can provide a proc that is called with default dataset
> that would be used, and should return a dataset to be used:
>
> Albums.eager(:daily_sales_figures =>
> proc{|ds| ds.filter(...).select(...)})
>
> Using callbacks in this way is much more flexible, and probably more
> concise in most cases. What do you think?
>
I wish I understood using procs better. :-)
Are there any blog postings or tutorials out there that cover
employing procs in a more readable/use-case scenario? I've seen a few
that talk about procs and give examples, but not in the context of how
I can actually put one to use. The examples are usually quite exotic,
at least to me. The above short example is actually the few *useful*
scenarios I've seen for how one might employ procs.
Michael
--
http://codeconnoisseur.org
--
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.