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

Commit

Permalink
Merge pull request #518 from 18F/ad-hotfix-veil-winning-bidder-from-api
Browse files Browse the repository at this point in the history
omit winning bid in api
  • Loading branch information
adelevie committed May 4, 2016
2 parents c989048 + 9a043fa commit f2aaae7
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 34 deletions.
13 changes: 1 addition & 12 deletions app/serializers/auction_serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ class AuctionSerializer < ActiveModel::Serializer
:start_price,
:summary,
:title,
:updated_at,
:winning_bid
:updated_at
)

def bids
Expand All @@ -35,14 +34,4 @@ def end_datetime
def start_datetime
object.start_datetime.iso8601
end

def winning_bid
WinningBidSerializer.new(find_winning_bid)
end

private

def find_winning_bid
RulesFactory.new(object).create.winning_bid
end
end
11 changes: 0 additions & 11 deletions spec/support/api/schemas/auction.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,6 @@
"type": "string",
"minLength": 1
},
"winning_bid": {
"type": "object",
"properties": {
"amount": {
"type": ["number", "null"]
},
"bidder_id": {
"type": ["number", "null"]
}
}
},
"bids": {
"type": "array",
"uniqueItems": true,
Expand Down
11 changes: 0 additions & 11 deletions spec/support/api/schemas/auctions.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,6 @@
"type": "string",
"minLength": 1
},
"winning_bid": {
"type": "object",
"properties": {
"amount": {
"type": ["number", "null"]
},
"bidder_id": {
"type": ["number", "null"]
}
}
},
"bids": {
"type": "array",
"uniqueItems": true,
Expand Down

0 comments on commit f2aaae7

Please sign in to comment.