1
0
Fork 0
forked from OpenNeo/impress
impress/app/controllers/contributions_controller.rb

19 lines
550 B
Ruby
Raw Normal View History

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]
Contribution.preload_contributeds_and_parents(
@contributions,
:scopes => {
2024-01-24 03:54:43 -08:00
'PetType' => PetType.includes(:species, :color),
'AltStyle' => AltStyle.includes(:species, :color),
}
)
2010-11-06 08:52:58 -07:00
end
end