From aeac7cd4722011d15ca34b89d5d2bbf86bfcefd3 Mon Sep 17 00:00:00 2001 From: lpichler Date: Mon, 21 May 2018 18:04:17 +0200 Subject: [PATCH 1/2] Remove support for unicode_hex in chargeback currencies Never been used and it would be need more work to add more currencies. --- app/models/chargeback_rate_detail_currency.rb | 1 - db/fixtures/chargeback_rate_detail_currencies.yml | 6 +----- spec/models/chargeback_rate_detail_currency_spec.rb | 3 --- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/app/models/chargeback_rate_detail_currency.rb b/app/models/chargeback_rate_detail_currency.rb index f6f8fabd02c..54de0f470c9 100644 --- a/app/models/chargeback_rate_detail_currency.rb +++ b/app/models/chargeback_rate_detail_currency.rb @@ -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" diff --git a/db/fixtures/chargeback_rate_detail_currencies.yml b/db/fixtures/chargeback_rate_detail_currencies.yml index 644ff6f9c81..2cb272d0ffa 100644 --- a/db/fixtures/chargeback_rate_detail_currencies.yml +++ b/db/fixtures/chargeback_rate_detail_currencies.yml @@ -3,19 +3,15 @@ :name: "Dollars" :full_name: "United States Dollars" :symbol: "$" - :unicode_hex: "36" - :code: "EUR" :name: "Euro" :full_name: "Euro" :symbol: "€" - :unicode_hex: "8364" - :code: "GBP" :name: "Pounds" :full_name: "Pound Sterling" :symbol: "£" - :unicode_hex: "163" - :code: "JPY" :name: "Yen" :full_name: "Japanese Yen" - :symbol: "¥" - :unicode_hex: "165" + :symbol: "¥" \ No newline at end of file diff --git a/spec/models/chargeback_rate_detail_currency_spec.rb b/spec/models/chargeback_rate_detail_currency_spec.rb index 2f9128331e1..a6f33778a10 100644 --- a/spec/models/chargeback_rate_detail_currency_spec.rb +++ b/spec/models/chargeback_rate_detail_currency_spec.rb @@ -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 From d87167e2cadb807d6b3091baa7071a16647e22ef Mon Sep 17 00:00:00 2001 From: lpichler Date: Mon, 21 May 2018 18:37:46 +0200 Subject: [PATCH 2/2] Add missing currencies to chargeback currencies Yaml - ordered by :code: --- .../chargeback_rate_detail_currencies.yml | 74 +++++++++++++++++-- 1 file changed, 69 insertions(+), 5 deletions(-) diff --git a/db/fixtures/chargeback_rate_detail_currencies.yml b/db/fixtures/chargeback_rate_detail_currencies.yml index 2cb272d0ffa..b2bdb7fbe78 100644 --- a/db/fixtures/chargeback_rate_detail_currencies.yml +++ b/db/fixtures/chargeback_rate_detail_currencies.yml @@ -1,8 +1,24 @@ --- -- :code: "USD" - :name: "Dollars" - :full_name: "United States Dollars" - :symbol: "$" +- :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" @@ -11,7 +27,55 @@ :name: "Pounds" :full_name: "Pound Sterling" :symbol: "£" +- :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: "¥" \ No newline at end of file + :symbol: "¥" +- :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"