Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Ian Drysdale's Profile

GitHub User: idrysdale

Comments by Ian Drysdale


I ended up using:

  joins(:events).where(" IN (SELECT MAX(id) FROM user_events GROUP BY user_id) AND state = 'open'")

Hope that helps.


I'd be interested to hear more about how you're approaching aggregation. I've started implementing an activity stream and am running into this challenge now.

Also, I'm trying to think of a good design pattern for how comments on aggregate stories should work. You can see more here:


Yeah - I'm experiencing this too. I tweaked the code but now it appears to finds all the orders that are both in that state currently, or have at some point been in that particular state, which isn't quite working either.


Fantastic clip there, thanks for sharing.