On Jul 5, 9:59 am, Scott LaBounty <[email protected]> wrote:
> OK, I got it to work with this:
>
> response_id = request[:choices]
> Ramaze::Log.debug("Poll title = #{session[:today_poll].title}
> choice = #{response_id}")
> r = Response[response_id]
> Ramaze::Log.debug("Current response = #{r.response} Current
> count = #{r.count}")
> r[:count] = r[:count] + 1
> r.save
> Ramaze::Log.debug("Current response = #{r.response} Current
> count = #{r.count}")
>
> I'm still not sure why what I posted earlier didn't work. It seems like
> they're pretty much equivalent.
>
> Anyone who can enlighten me?
Sequel doesn't use an identity map by default, so every time you call
Response[response_id], you get a new object back. If you want code
like that to work, you need to use the identity_map plugin.
Jeremy
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---