workarea-gift_cards 3.4.6 → 3.4.7
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9d7de57c4a153c5b92900c297f42786294dd6f220a3076882b07438e5188cf8d
|
4
|
+
data.tar.gz: 81d907ede71b16a26ec40ddc7825669f53f8561a29e9d5c15441651e1f97df58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0f9b7167699bd327d84804eb7bddb785e503d58431ccfc72bc0a8957714907190d13ddfe6e1f85be11ff49967daa7c9f4cc82019d5f23e86c61e8c2fc54f8109
|
7
|
+
data.tar.gz: 3664b302fb5174171372e9143ccd25e1beffe5d05eb64e3c86de18997d4c03156a10e145622e0203f2f3c307679377916d57ea04a855c9369763ea36099b0bfa
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
Workarea Gift Cards 3.4.7 (2019-09-04)
|
2
|
+
--------------------------------------------------------------------------------
|
3
|
+
|
4
|
+
* Always Use Configured Currency For Default Values (#1)
|
5
|
+
|
6
|
+
When specifying a `default:` for a Mongoid `Money` field, use an Integer
|
7
|
+
type like `0` instead of converting it to a Money type, as this will get
|
8
|
+
evaluated at compile-time rather than at runtime. Doing so preserves
|
9
|
+
the currency configuration specified by the application at runtime.
|
10
|
+
|
11
|
+
|
1
12
|
Workarea Gift Cards 3.4.6 (2019-08-21)
|
2
13
|
--------------------------------------------------------------------------------
|
3
14
|
|
@@ -16,9 +16,9 @@ module Workarea
|
|
16
16
|
# by a customer purchasing it.
|
17
17
|
field :order_id, type: String
|
18
18
|
|
19
|
-
field :amount, type: Money, default: 0
|
20
|
-
field :used, type: Money, default: 0
|
21
|
-
field :balance, type: Money, default: 0
|
19
|
+
field :amount, type: Money, default: 0
|
20
|
+
field :used, type: Money, default: 0
|
21
|
+
field :balance, type: Money, default: 0
|
22
22
|
|
23
23
|
has_many :redemptions, class_name: 'Workarea::Payment::GiftCard::Redemption'
|
24
24
|
|
@@ -3,6 +3,24 @@ require 'test_helper'
|
|
3
3
|
module Workarea
|
4
4
|
class Payment
|
5
5
|
class GiftCardTest < TestCase
|
6
|
+
def test_currency
|
7
|
+
existing_currency = Money.default_currency
|
8
|
+
usd = Money::Currency.new('USD')
|
9
|
+
aud = Money::Currency.new('AUD')
|
10
|
+
|
11
|
+
card = GiftCard.create!(amount: 10.to_m)
|
12
|
+
Money.default_currency = usd
|
13
|
+
|
14
|
+
assert_equal(usd, card.used.currency)
|
15
|
+
|
16
|
+
Money.default_currency = aud
|
17
|
+
card = GiftCard.create!(amount: 10.to_m)
|
18
|
+
|
19
|
+
assert_equal(aud, card.used.currency)
|
20
|
+
ensure
|
21
|
+
Money.default_currency = existing_currency
|
22
|
+
end
|
23
|
+
|
6
24
|
def test_not_expired
|
7
25
|
expired = Workarea::Payment::GiftCard.create!(amount: 10.to_m, expires_at: Time.now - 1.day)
|
8
26
|
not_expired = Workarea::Payment::GiftCard.create!(amount: 10.to_m, expires_at: Time.now + 1.day)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: workarea-gift_cards
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bcrouse
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: workarea
|
@@ -220,7 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
220
220
|
- !ruby/object:Gem::Version
|
221
221
|
version: '0'
|
222
222
|
requirements: []
|
223
|
-
rubygems_version: 3.0.
|
223
|
+
rubygems_version: 3.0.6
|
224
224
|
signing_key:
|
225
225
|
specification_version: 4
|
226
226
|
summary: Gift Cards plugin for the Workarea commerce platform
|