Jeremy,

Thanks for the explanation. I have no idea what an identity map is so I'll
a) stick with this for now and b) go look it up. Just for the record though,
is the way I ended up doing it, the way one "normally" would?

Scott

On Sun, Jul 5, 2009 at 3:12 PM, Jeremy Evans <[email protected]> wrote:

>
>
>
> 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
> >
>


-- 
Scott
http://steamcode.blogspot.com/

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to