So the way to do that right now is:
>> dataset.update_sql(:exp => 'exp + 10'.lit)
=> "UPDATE table SET exp = exp + 10"
But I agree that there should be a simpler way of doing this.. maybe
update can take a filter style block so update{ :exp += 10 } works?
Aman Gupta
On Dec 14, 2:45 am, Jim Morris <[EMAIL PROTECTED]> wrote:
> Ok maybe I missed this in the docs but it has me stumped..
>
> How do I do the equivalent of this...
>
> UPDATE atable SET acol = acol + 10 WHERE something = this;
>
> I tried this...
>
> profile.filter(:user_id == u).update("experience = experience + 10")
>
> and
>
> profile.filter(:user_id == u).update(:experience = :experience + 10)
>
> what of course would be nice is this...
>
> profile.filter(:user_id == u).update(:experience += 10)
>
> but none of those work of course.
>
> Any ideas?
>
> Thanks
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---