Sergio,

> Inheriting from AbstractComparison registers (see self.inherited) my custom
> comparison and it's slug is then listen between the Comparison.slugs.
>
> But my call
>
> Person.all(:name.bw => 'Serg')
>
> ...still fails: undefined method `bw' for :name:Symbol.

Look inside lib/dm-core/core_ext/symbol.rb inside the dm-core gem.

Those methods need to be added into the Symbol namespace. Keep in mind
that monkey patching core classes is somewhat dangerous, and you have
to be aware of overwriting methods that are already present *and*
potential conflicts with other libraries that may be doing the same.

In retrospect, I'm not sure I would've monkey patched Symbol the way
we did in the API. Or I'd at least make it optional (and turn it off
by default) so that people who want it have to enable it, knowing the
risks beforehand. I'm considering doing this in DM2 in the future,
since it's a major API change and would break alot of apps if I did it
in the 1.x series.

--

Dan

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en.

Reply via email to