This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
grindable/app/controllers/activity_controller.rb

19 lines
686 B
Ruby

class ActivityController < ApplicationController
append_before_filter :verify_identity
append_before_filter :add_refresh_link, :only => [ 'index' ]
append_before_filter :find_fund, :only => [ 'index' ]
##
# This method will display a list of the purchases for the fund, starting
# with the oldest. Also handily paginated by default. Lookit, four lines!
#
def index
unless @fund.nil?
@purchase_pages, @purchases = paginate :ledger, :order =>
"ledgers.post_date DESC, ledgers.created_at DESC",
:conditions => [ 'ledgers.fund_id = ?', @fund.id ],
:joins => "LEFT JOIN baristas ON ledgers.barista_id = baristas.id"
end
end
end