On 15/09/09 9:14 AM, Dan Kubb (dkubb) wrote:
>
> Hi All,
>
>> I can't think of anything in dm-core or dm-more that requires
>> ParseTree.
>
> I should mention that it looks like one part of dm-sweatshop requires
> ParseTree to function: DataMapper::Sweatshop::Unique
>
> If you use dm-sweatshop to generate unique values, it may not work
> with Ruby 1.9 right now. I don't use the feature myself in anything
> that works with 1.9, so I'm not sure if it can be made to work without
> ParseTree, but if someone is willing to look into it I'd be grateful.
Part of the api relies on equating two lambdas
unique { /\w+/.gen } # This block is used as the identity for this
uniqueness constraint
, so we either need to:
1) Deprecate this (require every unique call to have an explict name:
unique(:my_constraint) { ... }
2) Fix ParseTree (is this even feasible? Is it broken because it can't
be fixed or because no one has done it?)
3) Find another way of comparing lambdas
4) Revert back to the old way of ensuring uniqueness (just keep retrying
values until the object saves)
#2 would be ideal if possible, though I know next to nothing about
parsetree so can't comment. I'm hoping someone on the list pipes up with
"oh #3 is easy". #1 would be a shame since the anonymous blocks are kind
of neat, #4 is ugly but should work I think.
Xav
>
> --
>
> Dan
> (dkubb)
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---