Skip to content

Commit

Permalink
Merge pull request #17456 from lpichler/add_more_currencies_to_charge…
Browse files Browse the repository at this point in the history
…back

Add more currencies to chargeback
  • Loading branch information
jrafanie authored May 21, 2018
2 parents 6f61221 + d87167e commit 9720be7
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 12 deletions.
1 change: 0 additions & 1 deletion app/models/chargeback_rate_detail_currency.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class ChargebackRateDetailCurrency < ApplicationRecord
validates :name, :presence => true, :length => {:maximum => 100}
validates :full_name, :presence => true, :length => {:maximum => 100}
validates :symbol, :presence => true, :length => {:maximum => 100}
validates :unicode_hex, :presence => true, :length => {:minimum => 1}

has_many :chargeback_rate_detail, :foreign_key => "chargeback_rate_detail_currency_id"

Expand Down
76 changes: 68 additions & 8 deletions db/fixtures/chargeback_rate_detail_currencies.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,81 @@
---
- :code: "USD"
:name: "Dollars"
:full_name: "United States Dollars"
:symbol: "$"
:unicode_hex: "36"
- :code: "AUD"
:name: "Dollar"
:full_name: "Australian Dollar"
:symbol: "A$"
- :code: "BRL"
:name: "Brazilian real"
:full_name: "Brazilian real"
:symbol: "R$"
- :code: "CAD"
:name: "Dollar"
:full_name: "Canadian Dollar"
:symbol: "C$"
- :code: "CHF"
:name: "Swiss franc"
:full_name: "Swiss franc"
:symbol: "Fr"
- :code: "CNY"
:name: "Renminbi"
:full_name: "Renminbi"
:symbol: ""
- :code: "EUR"
:name: "Euro"
:full_name: "Euro"
:symbol: ""
:unicode_hex: "8364"
- :code: "GBP"
:name: "Pounds"
:full_name: "Pound Sterling"
:symbol: "£"
:unicode_hex: "163"
- :code: "HKD"
:name: "Dollar"
:full_name: "Hong Kong dollar"
:symbol: "HK$"
- :code: "INR"
:name: "Indian rupee"
:full_name: "Indian rupee"
:symbol: ""
- :code: "JPY"
:name: "Yen"
:full_name: "Japanese Yen"
:symbol: "¥"
:unicode_hex: "165"
- :code: "KRW"
:name: "South Korean won"
:full_name: "South Korean won"
:symbol: ""
- :code: "MXN"
:name: "Mexican peso"
:full_name: "Mexican peso"
:symbol: "$"
- :code: "NZD"
:name: "Dollar"
:full_name: "New Zealand dollar"
:symbol: "NZ$"
- :code: "NOK"
:name: "Norwegian krone"
:full_name: "Norwegian krone"
:symbol: "kr"
- :code: "RUB"
:name: "Russian ruble"
:full_name: "Russian ruble"
:symbol: ""
- :code: "SEK"
:name: "Swedish krona"
:full_name: "Swedish krona"
:symbol: "kr"
- :code: "SGD"
:name: "Dollar"
:full_name: "Singapore dollar"
:symbol: "S$"
- :code: "TRY"
:name: "Turkish lira"
:full_name: "Turkish lira"
:symbol: ""
- :code: "USD"
:name: "Dollars"
:full_name: "United States Dollars"
:symbol: "$"
- :code: "ZAR"
:name: "South African rand"
:full_name: "South African rand"
:symbol: "R"
3 changes: 0 additions & 3 deletions spec/models/chargeback_rate_detail_currency_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,4 @@
it "is invalid without a symbol" do
expect(FactoryGirl.build(:chargeback_rate_detail_currency, :symbol => nil)).not_to be_valid
end
it "is invalid without a unicode_hex" do
expect(FactoryGirl.build(:chargeback_rate_detail_currency, :unicode_hex => nil)).not_to be_valid
end
end

0 comments on commit 9720be7

Please sign in to comment.