Skip to content

Commit

Permalink
fixed an attempt to send nil tips
Browse files Browse the repository at this point in the history
  • Loading branch information
sashazykov committed Apr 6, 2014
1 parent 846d3aa commit c3aada8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/user.rb
Expand Up @@ -21,7 +21,7 @@ def github_url
end

def balance
tips.unpaid.sum(:amount)
tips.decided.unpaid.sum(:amount)
end

def full_name
Expand Down
2 changes: 1 addition & 1 deletion lib/bitcoin_tipper.rb
Expand Up @@ -56,7 +56,7 @@ def self.create_sendmany
outs = {}
User.find_each do |user|
if user.bitcoin_address.present? && user.balance > CONFIG["min_payout"]
user.tips.unpaid.each do |tip|
user.tips.decided.unpaid.each do |tip|
tip.update_attribute :sendmany_id, sendmany.id
outs[user.bitcoin_address] = outs[user.bitcoin_address].to_i + tip.amount
end
Expand Down

0 comments on commit c3aada8

Please sign in to comment.