Skip to content

Commit

Permalink
Fix bootcamp data
Browse files Browse the repository at this point in the history
  • Loading branch information
iHiD committed Nov 21, 2024
1 parent 5b89b96 commit d67c6fc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions app/models/user/bootcamp_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,15 @@ def country_data
DATA[ppp_country]
end

def has_discount? = country_data
def has_discount? = !!country_data

def discount_percentage
((COMPLETE_PRICE - @complete_price) / COMPLETE_PRICE * 100).round
case package
when 'complete'
((COMPLETE_PRICE - price) / COMPLETE_PRICE * 100).round
else
((PART_1_PRICE - price) / PART_1_PRICE * 100).round
end
end

DATA = JSON.parse(File.read(Rails.root / 'config' / 'bootcamp.json')).freeze
Expand Down

0 comments on commit d67c6fc

Please sign in to comment.