Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more currencies to chargeback #17456

Merged
merged 2 commits into from
May 21, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a followup PR for the migration to drop this column?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes and also maybe more column. (not sure about usage of name)

about unicode_hex I am just thinking if we should keep this column for any display reasons. (I did not meet any displaying issue of listed currency's symbols )

- :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