hstore_accessor 1.1.0 → 1.1.1
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 +4 -4
- data/README.md +5 -3
- data/lib/hstore_accessor/serialization.rb +1 -1
- data/lib/hstore_accessor/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed5e78754502baeb91372d4500d2d4be8b134252
|
4
|
+
data.tar.gz: 1d14aa11578ec8d38afb2c2d758f2472ab3a93ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6626df37bbe37e75ef4bd1e6e749a86e78498785d9e6767892ee925e0eb9cb7acf8c5e489ed5c656376926a460966c8b49317e163718d240ccd1336b879c2e8
|
7
|
+
data.tar.gz: 3c2f62aaf2f43a2e39f94dc59974dbb095b5f77df2e5ec7847123edcb72d344d954718f733a728f6dc14160275745546527fd946768147aeab116aa198bcd77f
|
data/README.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# HstoreAccessor
|
2
2
|
|
3
|
-
|
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 }
|
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.
|
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-
|
15
|
+
date: 2017-10-20 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: activerecord
|