I am trying to find a particular (in this case the last, or most
recent) status for a user. As a user does certain things, new statuses
are added (into users_statuses).
I want to be able to show a list of users with their current status. I
get as far as at least getting the full list of users (@users =
User.find(:all)), but not sure how to output the list with just the
most recent status?
<<< The models >>>
class User < ActiveRecord::Base
has_many :statuses, :through => :users_statuses
class Status < ActiveRecord::Base
has_many :users, :through => :users_statuses
class UserStatus < ActiveRecord::Base
<<< The controller >>>
@users = User.find(:all)