2010-11-06 08:52:58 -07:00
|
|
|
class ContributionsController < ApplicationController
|
|
|
|
def index
|
2010-11-06 08:57:22 -07:00
|
|
|
if params[:user_id]
|
|
|
|
@user = User.find params[:user_id]
|
|
|
|
@contributions = @user.contributions
|
|
|
|
else
|
|
|
|
@contributions = Contribution.includes(:user)
|
|
|
|
end
|
|
|
|
@contributions = @contributions.recent.paginate :page => params[:page]
|
2013-01-25 13:23:48 -08:00
|
|
|
Contribution.preload_contributeds_and_parents(
|
|
|
|
@contributions,
|
|
|
|
:scopes => {
|
|
|
|
'Item' => Item.includes(:translations),
|
2024-01-24 03:54:43 -08:00
|
|
|
'PetType' => PetType.includes(:species, :color),
|
|
|
|
'AltStyle' => AltStyle.includes(:species, :color),
|
2013-01-25 13:23:48 -08:00
|
|
|
}
|
|
|
|
)
|
2010-11-06 08:52:58 -07:00
|
|
|
end
|
|
|
|
end
|