strict_money 0.2.0 → 0.3.0

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: cb4adcabdacb785a087ea8549695d625fe7df0ebdedda3746c83da04364ee8bc
4
- data.tar.gz: f3cc4f0b6fd955857394a27f65eb75a8bd83a772c43a8414106b84576a68dad5
3
+ metadata.gz: 3f1d0d98c2cc60330eaf48ae5b1fa13f98d7348bfa237e335aae89237e1c8fdc
4
+ data.tar.gz: 7c3859e13cf3ae630d269b60e083ca5aa669f231e07c212c10bca735c81bff9c
5
5
  SHA512:
6
- metadata.gz: 5f1314942fb80cea05d8f2fc2eed57cac80eb32b3bd760d4b4144a3a31f0e9a30b226b5e7130ea1b5ae6da2f8fbedaeea540b3fcf1dd7269d69e3482e5122d9a
7
- data.tar.gz: 0e7f81ae2133c5b55fda150bbf056dd787d9e6bdbdd3fe42662c5da189834e69005bcef5ece5ed503c953f333305e78b5937ad81d587263b8505c3be613fb8de
6
+ metadata.gz: 3eb49d358d72a98917f2b31a0f84ebc911d5e7e814798514a9a330b8319f78ed2084d00af43866908110fd5eef62f3bccccded7e133436bb1fc107a76775a68d
7
+ data.tar.gz: a0ae54dc06c07bf04c5feea5a778ec1b34aed59f6bbd8e18a43a8d5a098181257880320d3e72d8fbf749700393d870eee19f8354365efad5e03a442ec92092fd
@@ -8,7 +8,7 @@ module StrictMoney
8
8
  @demongoize_block = block
9
9
  elsif @demongoize_block
10
10
  @demongoize_block.call(object)
11
- else
11
+ elsif object
12
12
  StrictMoney::Amount.new(object['amount'], object['currency'])
13
13
  end
14
14
  end
@@ -1,7 +1,7 @@
1
1
  # Supply validation macros for Mongoid classes that embed StrictMoney::Amount.
2
2
  class FinancialityValidator < ActiveModel::EachValidator
3
3
  def check_validity!
4
- invalid_keys = options.keys - [:positive, :not_negative]
4
+ invalid_keys = options.keys - [:allow_nil, :positive, :not_negative]
5
5
  raise "Invalid keys #{invalid_keys.inspect} for financiality validator" if invalid_keys.present?
6
6
  end
7
7
 
@@ -1,3 +1,3 @@
1
1
  module StrictMoney
2
- VERSION = "0.2.0".freeze
2
+ VERSION = "0.3.0".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strict_money
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francis Hwang