On Feb 23, 4:56 pm, Phrogz <[email protected]> wrote:
>   def vote_total
>     votes.inject(0){ |sum,vote| sum + vote.count }
>   end

When writing up a pared down test case doesn't give the answer,
hitting send on a global email most often will. :)

I discovered that changing the above to
  votes_dataset.all.inject...
prevents it from returning an array of cached records.

This leaves me with two questions:
1) Why is votes() returning the cached set, and
2) Of course my technique of discovering changed composite values
can't possibly work in a before_save hook alone. My best thoughts now
are adding a custom pre_modify call that caches all 'interesting'
values for the before_save to compare against. If someone else has run
into this need before, how have you solved it?
--~--~---------~--~----~------------~-------~--~----~
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