redmine_crm 0.0.11 → 0.0.12

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: da656709e1098bcc04bf4d41e9b538cfe63204ec
4
- data.tar.gz: 4cf2db4f870f18f9211204145d9948e7f87caf30
3
+ metadata.gz: eb4edcbb29e05cd8cfc1107b19cf57c3d20f9d2f
4
+ data.tar.gz: b38fdf655eabf2265a2148a48e19934bb5889394
5
5
  SHA512:
6
- metadata.gz: a591c5aed685f5d422a8ee25e7d29ab98b10cb554e6f3008d73a7f2abf45632cb10d8d776e2a6a1f02a5982f215c6fb0d64b5603b8d47ef8f70eea5150cdd205
7
- data.tar.gz: 850c9de21919dfaac1a9fb89224b89006bfc0b2d507b5f7108488f0232cddf47033f9353ba37b04e0f6ab1cd8c36509e49854e5820b1c7b23a9c4f6088757c47
6
+ metadata.gz: 6ab2ddf4fb0123cbbe857378ae6fd31a0daa6de544c4efda9f2162dfea355ca0931c5b0d34c25d8bb2c929b4dc653d6a1f813f05a80781c68fe566db877a9f3b
7
+ data.tar.gz: 8a8c3757b763d17b5035685420650934a3d56608932ccb4d70c3250e8c3d83336e6d30a9d21ad850d2c9cd058be18b576278165f03f2a78550046eba3c2166c2
@@ -51,15 +51,14 @@ module RedmineCrm
51
51
  end.sort{|x, y| x[0] <=> y[0]}
52
52
  end
53
53
 
54
- def price_to_currency(price, currency=RedmineCrm::Currency.find("USD"), options={})
54
+ def price_to_currency(price, currency="USD", options={})
55
55
  return '' if price.blank?
56
-
57
- if currency.is_a? String
58
- currency = RedmineCrm::Currency.find(currency)
59
- else
60
- currency = RedmineCrm::Currency.find("USD")
61
- end
62
- RedmineCrm::Currency.format(price.to_f, currency)
56
+
57
+ currency = "USD" unless currency.is_a?(String)
58
+ currency = RedmineCrm::Currency.find(currency)
59
+
60
+ return RedmineCrm::Currency.format(price.to_f, currency) if currency
61
+ price.to_s
63
62
  end
64
63
 
65
64
 
@@ -1,3 +1,3 @@
1
1
  module RedmineCrm
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
@@ -6,5 +6,7 @@ class MoneyHelperTest < ActiveSupport::TestCase
6
6
  def test_price_to_currency
7
7
  assert_equal '$3,265.65', price_to_currency(3265.65, "USD")
8
8
  assert_equal "3.265,65 ₽", price_to_currency(3265.65, "RUB")
9
+ assert_equal "3200", price_to_currency(3200, "")
10
+ assert_equal "3200", price_to_currency(3200, "Foo")
9
11
  end
10
12
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redmine_crm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.11
4
+ version: 0.0.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - RedmineCRM
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-22 00:00:00.000000000 Z
11
+ date: 2015-08-24 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: plugins for Redmine
14
14
  email: