Skip to content

Commit

Permalink
Limiting to 20% for credits
Browse files Browse the repository at this point in the history
  • Loading branch information
spherop committed Oct 26, 2009
1 parent 1ac8313 commit 7077e85
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/donation.rb
Expand Up @@ -121,7 +121,7 @@ def check_donation
if donation_type == "credit"
check_credit
end
if !pitch.user_can_donate_more?(user, self.amount)
unless pitch.user_can_donate_more?(user, self.amount)
errors.add_to_base("Thanks for your support but we only allow donations of 20% of requested amount from one user. Please lower your donation amount and try again.")
return
end
Expand Down
1 change: 0 additions & 1 deletion app/models/pitch.rb
Expand Up @@ -288,7 +288,6 @@ def default_donation_amount
end

def user_can_donate_more?(user, attempted_donation_amount)
debugger
return false if attempted_donation_amount.nil?
return true if user.organization? && attempted_donation_amount <= requested_amount
return false if attempted_donation_amount > funding_needed
Expand Down

0 comments on commit 7077e85

Please sign in to comment.