dynamo_record 0.0.18 → 0.0.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 639fd29aab8fe77e2c628d88c5f4878171546f84
4
- data.tar.gz: df847f09a82a7e71b1c31309573e6159c2a5541a
3
+ metadata.gz: 2dd63307555e1ae2fe549ff6881afac14b7967bc
4
+ data.tar.gz: bf8bdd27acfe11301789f1de5410eb7157aded69
5
5
  SHA512:
6
- metadata.gz: f74b5905523301507c6801519c98a5394a8b21a63ee12e1bbe395a64ccfe6b1ce132a0893e595e073c718aa3453ee1ec05ddacb6ff461307e7eee798f089c984
7
- data.tar.gz: 2c645422e313ea408eaaa3ea39e1b3a94e339de087200f7a904bb00cc196f60cf611b0a776c682223dc7e26f9d9ef91ee61829914e1e09335ce971917c3a3a01
6
+ metadata.gz: c0ea8f49c85a9a7ab830491a6c3d010688cb0f4607bf6efb25bd44188fbb22922979d945f673f229bd4c4b1d45aa07d970fd29e9534340d149a2adc6f4c8c642
7
+ data.tar.gz: 2223d8a200ac4d0f5518dcb0a6fffc6dabd816f72aff59ad016874d0c10e0d09b4e7e94365fff57168e2c117fb24dde90199495bcfc56a178ffc9b20f59e0d00
@@ -31,8 +31,8 @@ module DynamoRecord
31
31
  value.to_i
32
32
  when :string
33
33
  value.to_s
34
- when :float
35
- value.to_f
34
+ when :big_decimal
35
+ value.to_d
36
36
  when :boolean
37
37
  if value == "true" || value == true
38
38
  true
@@ -84,7 +84,7 @@ module DynamoRecord
84
84
 
85
85
  def dynamodb_type(type)
86
86
  case type
87
- when :integer, :float
87
+ when :integer, :big_decimal
88
88
  'N'
89
89
  when :string, :datetime
90
90
  'S'
@@ -1,3 +1,3 @@
1
1
  module DynamoRecord
2
- VERSION = "0.0.18"
2
+ VERSION = "0.0.19"
3
3
  end
@@ -39,13 +39,13 @@ RSpec.describe DynamoRecord::Fields do
39
39
  include DynamoRecord::Document
40
40
 
41
41
  field :integer_field, :integer
42
- field :float_field, :float
42
+ field :big_decimal_field, :big_decimal
43
43
  field :datetime_field, :datetime
44
44
  field :boolean_field, :boolean
45
45
  end
46
46
 
47
47
  expect(Record.new(integer_field: '1').integer_field).to be_a(Fixnum)
48
- expect(Record.new(float_field: '1').float_field).to be_a(Float)
48
+ expect(Record.new(big_decimal_field: '1').big_decimal_field).to be_a(BigDecimal)
49
49
  expect(Record.new(datetime_field: '2014-12-25T04:08:25Z').datetime_field).to eq(DateTime.parse('2014-12-25T04:08:25Z'))
50
50
  expect(Record.new(boolean_field: 'true').boolean_field).to be_truthy
51
51
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamo_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nguyen Vu Nguyen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-24 00:00:00.000000000 Z
11
+ date: 2015-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport