Skip to content

Commit

Permalink
fixed error calculating ABD
Browse files Browse the repository at this point in the history
  • Loading branch information
greggroth committed Feb 19, 2012
1 parent 2fc1416 commit 42a7980
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/beer_item.rb
Expand Up @@ -51,7 +51,7 @@ def bar_name
end

def abd
return 0 if (self.beer.abv.nil? || self.volume.nil? || self.price.nil?)
return 0 if (self.beer.abv.nil? || self.volume.nil? || self.price.nil? || (self.price==0))
if self.pouring == "bucket"
case self.volunit
when 'oz'
Expand Down
2 changes: 1 addition & 1 deletion app/views/beer_items/_best_deals.html.slim
Expand Up @@ -8,7 +8,7 @@ table id="sorted_beer_item_list" class="itemlist"
th width=100 class="abd-table-heading" ABD
th width=80 Price
tbody
- for deal in BeerItem.top_deals do
- BeerItem.top_deals.each do |deal|
tr
td = link_to(deal.beer.name, deal.beer)
td = link_to(deal.bar.name, deal.bar)
Expand Down

0 comments on commit 42a7980

Please sign in to comment.