Join wayne and I in #sequel on freenode
The plugin_options approach is no longer being used, so subclassing
should not be a problem. Here's my latest feature-complete version of
orderable: http://pastie.caboo.se/123992
Still to do: error checking, formal specs, is :Orderable, :scope
=> :list_id (to allow positioning items within the context of
a :list_id)..
One question, is there a better way of doing this:
dataset.update(position_field => "#{position_field} + 1".lit)
Aman Gupta
On Dec 1, 12:07 am, "Mark Van De Vyver" <[EMAIL PROTECTED]> wrote:
> Hi
>
> On Dec 1, 2007 3:16 PM, Wayne E. Seguin <[EMAIL PROTECTED]> wrote:
>
>
>
> > Ok, current thought is to keep a config lookup hash:
>
> > module Sequel
> > module Plugins
> > Config = {}
> > end
> > end
>
> > Usage:
> > Config[ModelClass][PluginName] = {*options}
>
> > class LineItem < Sequel::Model(:line_items)
> > is_a :list, :field => :position
> > end
>
> > With a helper method in the class itself:
>
> > LineItem.plugin_options[:field] # => :position
>
> > One open question: Can anyone think of a case where we'd want to be able to
> > use a single plugin twice on the same model?
>
> May arise when sub-classing?
> The following is possibly off-topic.
> While strictly not a Sequel problem, I've been trying to merge
> Sequel's functionality with Og's - hopefully this will continue to be
> possible...
> Og does allow std Ruby type sub-classing of models, so it is
> conceivable that a parent 'is <plugin>' and then the subclass gets
> that plugin again?
>
> Mark
>
> > Thanks,
>
> > ~Wayne
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---