I have a category model, An Image model and a User model
Category:
has_many :images
has_many :users, :through=>'images'
Image:
belongs_to :category, :counter_cache => true
belongs_to :user
User:
has_many :images
Category.first.users //returning users but its not ordering ie :order=>' images uploaded by users in that category DESC'.
Category.all.collect(&:users) //returning users but its not ordering ie :order=>' images uploaded by users in that category DESC'..
- I need list of users for that category having top 25 users having maximum number of images in that category.
- I need top 25 users in two or more categories something like top 25 users in category 1 and 2.