xtol-sd/Auction — pull request #4 by Crystal08 (2013-07-07 01:56:39+00:00)
Title: Updates associations between User, Bid, Donation, and Item models and th...

...en uses the resulting methods to refactor my_bids view in items directory.

I think the methods these associations provide will allow us to clarify all our existing code and produce clearer code in future- but only if we all understand what the associations offer. Otherwise we'll reinvent the wheel.

When calling objects, especially through each other, refer back to http://guides.rubyonrails.org/association_basics.html

e.g. @user.bid_items is easier (with the proper associations)
is much easier than something like

user_bid_item_ids = []
@user.bids.each do |bid|
user_bid_item_ids << bid.item_id
end

user_bid_items = user_bid_items_ids.map{|id| Item.find(id)}