hstore_accessor 1.1.0 → 1.1.1

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: 125cfa4bc2b4858787a2ebffe05b762c8c84eed6
4
- data.tar.gz: 953d60cd270bbda806bc58543945b17d0994db13
3
+ metadata.gz: ed5e78754502baeb91372d4500d2d4be8b134252
4
+ data.tar.gz: 1d14aa11578ec8d38afb2c2d758f2472ab3a93ec
5
5
  SHA512:
6
- metadata.gz: 4ae46b954d55b60185a6e737544dc2700833b00157274de920d72dcb42199166f3cd4a116cffd993269bbffb8de35b252aec236d95c190c7e64698eef9f35972
7
- data.tar.gz: 291392514a75b48ba4d0ac00bbfa81deab3211583ed96babe6232b0f426c923fde3d0207f79dcd1cfece517d4dde83ac90bba87c92acf22f0b2a86ec1e76782b
6
+ metadata.gz: a6626df37bbe37e75ef4bd1e6e749a86e78498785d9e6767892ee925e0eb9cb7acf8c5e489ed5c656376926a460966c8b49317e163718d240ccd1336b879c2e8
7
+ data.tar.gz: 3c2f62aaf2f43a2e39f94dc59974dbb095b5f77df2e5ec7847123edcb72d344d954718f733a728f6dc14160275745546527fd946768147aeab116aa198bcd77f
data/README.md CHANGED
@@ -1,8 +1,10 @@
1
1
  # HstoreAccessor
2
2
 
3
- Hstore Accessor allows you to treat fields on an hstore column as though they were actual columns being picked up by ActiveRecord. This is especially handy when trying to avoid sparse columns while making use of [single table inheritence](#single-table-inheritance). Hstore Accessor currently supports ActiveRecord versions 4.0, 4.1, and 4.2.
3
+ ## Starting a new project? Use [Jsonb Accessor](https://github.com/devmynd/jsonb_accessor) instead! It has more features and is better maintained.
4
+
5
+ ## Description
6
+ Hstore Accessor allows you to treat fields on an hstore column as though they were actual columns being picked up by ActiveRecord. This is especially handy when trying to avoid sparse columns while making use of [single table inheritence](#single-table-inheritance). Hstore Accessor currently supports ActiveRecord versions 4.0, 4.1, 4.2, 5.0, and 5.1.
4
7
 
5
- Starting a new project or just not a fan of hstore? Check out [Jsonb Accessor](https://github.com/devmynd/jsonb_accessor)!
6
8
 
7
9
  ## Table of Contents
8
10
 
@@ -27,7 +29,7 @@ Starting a new project or just not a fan of hstore? Check out [Jsonb Accessor](h
27
29
  Add this line to your application's Gemfile:
28
30
 
29
31
  ```ruby
30
- gem "hstore_accessor"
32
+ gem "hstore_accessor", "~> 1.1"
31
33
  ```
32
34
 
33
35
  And then execute:
@@ -25,7 +25,7 @@ module HstoreAccessor
25
25
  DESERIALIZERS = {
26
26
  boolean: -> value { TypeHelpers.cast(:boolean, value) },
27
27
  date: -> value { value && Date.parse(value) },
28
- decimal: -> value { value && BigDecimal.new(value) },
28
+ decimal: -> value { value && (value == '' ? BigDecimal.new(0) : BigDecimal.new(value)) },
29
29
  float: -> value { value && value.to_f },
30
30
  integer: -> value { value && value.to_i },
31
31
  datetime: -> value { value && Time.at(value.to_i).in_time_zone }
@@ -1,3 +1,3 @@
1
1
  module HstoreAccessor
2
- VERSION = "1.1.0"
2
+ VERSION = "1.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hstore_accessor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joe Hirn
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2017-05-18 00:00:00.000000000 Z
15
+ date: 2017-10-20 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: activerecord