Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Commit

Permalink
Removing AuctionQuery wrappers for AuctionScopes
Browse files Browse the repository at this point in the history
While we might revisit whether or not to abstract away all scopes in the
AuctionQuery object in the future, not necessary for the current PR
  • Loading branch information
Jacob Harris committed Aug 24, 2016
1 parent 5bd4712 commit ad1813a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
12 changes: 2 additions & 10 deletions app/models/auction_query.rb
Expand Up @@ -25,20 +25,12 @@ def active_auction_count
end

def needs_attention_count
unpublished.count +
relation.unpublished.count +
pending_delivery.count +
pending_acceptance.count +
relation.pending_acceptance.count +
payment_needed.count
end

def unpublished
relation.unpublished
end

def pending_acceptance
relation.pending_acceptance
end

def completed
relation.accepted_or_rejected
end
Expand Down
4 changes: 2 additions & 2 deletions app/view_models/admin/needs_attention_auctions_view_model.rb
Expand Up @@ -12,7 +12,7 @@ def drafts_partial
end

def drafts
@_drafts ||= AuctionQuery.new.unpublished.map do |auction|
@_drafts ||= Auction.unpublished.map do |auction|
Admin::DraftListItem.new(auction)
end
end
Expand All @@ -38,7 +38,7 @@ def evaluation_needed_partial
end

def evaluation_needed
@_evaluation_needed ||= list_items(AuctionQuery.new.pending_acceptance)
@_evaluation_needed ||= list_items(Auction.pending_acceptance)
end

def payment_needed_partial
Expand Down

0 comments on commit ad1813a

Please sign in to comment.