attr_json 2.5.0 → 2.5.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e21592e154d496f3d17ac762b029e0f94e2e05e537183ae28d7739961285695e
4
- data.tar.gz: 665aa5b38773df1980a1472186deb9f7b6125001eb2dcfbf6346249160593c53
3
+ metadata.gz: c20881e34c2ba0c12d2c3f26a4b65516f392e3821d8e950b6adc3b0cb596c088
4
+ data.tar.gz: b86e73b6eb395c0b8454280f48b7e26f99a35ecfd5e8e6653935ecb8053c7135
5
5
  SHA512:
6
- metadata.gz: ab500628baea9ee71e6160a9eac6e08a498aebbb42887492a92c2d13bdc52e9d8b967a85abda82adc9a0493973c325a02b619f59425f8c738d467b1bc0cd5f65
7
- data.tar.gz: c1189f75fabc8aea03e8dc5099c621b2e92214058ddd3fa6379ddef0721681081ab96364b1179be6da3c23050848408a06e9cbac7e504895c25f651639c40e74
6
+ metadata.gz: 8897cb9ee4e99189e5bce6a47f2b1f656f46aaf5fb08b4eb65691bcf14ff776537b8eb11075b708d4afdb7a67875787b1e88f7ff76d2ca646b7b208324a9f3ac
7
+ data.tar.gz: be2bff872e38b68edaae48c6e5b84938a5864fe668aae8a4f2f900bdf4573715477c3d35d5f13eef9108beda8dce86970bb068234e5657edd9d3bd7d9bdbb329
@@ -35,33 +35,18 @@ jobs:
35
35
  - gemfile: rails_6_0
36
36
  ruby: 2.7
37
37
 
38
- - gemfile: rails_6_0
39
- ruby: '3.0'
40
-
41
38
  - gemfile: rails_6_1
42
39
  ruby: 2.7
43
40
 
44
41
  - gemfile: rails_6_1
45
42
  ruby: '3.0'
46
43
 
47
- - gemfile: rails_7_0
48
- ruby: '3.0'
49
-
50
44
  - gemfile: rails_7_0
51
45
  ruby: 3.1
52
46
 
53
47
  - gemfile: rails_7_0
54
48
  ruby: 3.2
55
49
 
56
- - gemfile: rails_7_1
57
- ruby: '3.0'
58
-
59
- - gemfile: rails_7_1
60
- ruby: 3.1
61
-
62
- - gemfile: rails_7_1
63
- ruby: 3.2
64
-
65
50
  - gemfile: rails_7_1
66
51
  ruby: 3.3
67
52
 
@@ -31,7 +31,7 @@ jobs:
31
31
  tests:
32
32
  services:
33
33
  db:
34
- image: postgres:9.4
34
+ image: postgres:10.0
35
35
  env:
36
36
  POSTGRES_USER: postgres
37
37
  POSTGRES_PASSWORD: postgres
data/CHANGELOG.md CHANGED
@@ -29,6 +29,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
29
29
 
30
30
  *
31
31
 
32
+ ## [2.5.1](https://github.com/jrochkind/attr_json/compare/v2.5.0...v2.5.1)
33
+
34
+ ## Fixed
35
+
36
+ * Fixed bug where date/datetime types required db to exist on app boot. https://github.com/jrochkind/attr_json/pull/242 Thanks @jNicker
37
+
38
+
32
39
  ## [2.5.0](https://github.com/jrochkind/attr_json/compare/v2.4.0...v2.5.0)
33
40
 
34
41
  ## Added
data/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # AttrJson
2
- [![CI Status](https://github.com/jrochkind/attr_json/workflows/CI/badge.svg?branch=master)](https://github.com/jrochkind/attr_json/actions/workflows/ci.yml?query=workflow%3ACI+branch%3Amaster)
3
- [![CI Status](https://github.com/jrochkind/attr_json/workflows/CI%20on%20Future%20Rails%20Versions/badge.svg?branch=master)](https://github.com/jrochkind/attr_json/actions/workflows/future_rails_ci.yml?query=workflow%3ACI+branch%3Amaster)
2
+
3
+ [![CI](https://github.com/jrochkind/attr_json/actions/workflows/ci.yml/badge.svg)](https://github.com/jrochkind/attr_json/actions/workflows/ci.yml)
4
+ [![CI on Future Rails Versions](https://github.com/jrochkind/attr_json/actions/workflows/future_rails_ci.yml/badge.svg)](https://github.com/jrochkind/attr_json/actions/workflows/future_rails_ci.yml)
4
5
  [![Gem Version](https://badge.fury.io/rb/attr_json.svg)](https://badge.fury.io/rb/attr_json)
5
6
 
6
7
  ActiveRecord attributes stored serialized in a json column, super smooth. For Rails 6.0.x through 7.0.x. Ruby 2.7+.
@@ -130,9 +130,8 @@
130
130
  # serializing, we're kind of stuck with this precision in current implementation.
131
131
  lookup_kwargs = { adapter: nil }
132
132
  if type == :datetime || type == :time
133
- lookup_kwargs = { precision: ActiveSupport::JSON::Encoding.time_precision }
133
+ lookup_kwargs[:precision] = ActiveSupport::JSON::Encoding.time_precision
134
134
  end
135
-
136
135
  type = ActiveRecord::Type.lookup(type, **lookup_kwargs)
137
136
  elsif !(type.is_a?(ActiveModel::Type::Value) || type.is_a?(ActiveRecord::AttributeMethods::TimeZoneConversion::TimeZoneConverter))
138
137
  raise ArgumentError, "Second argument (#{type}) must be a symbol or instance of an ActiveModel::Type::Value subclass"
@@ -65,7 +65,7 @@ module AttrJson
65
65
  attr_name = attribute_def.name
66
66
  value = container_value[attribute_def.store_key]
67
67
 
68
- if value
68
+ unless value.nil?
69
69
  # TODO, can we just make this use the setter?
70
70
  write_attribute(attr_name, value)
71
71
 
@@ -1,3 +1,3 @@
1
1
  module AttrJson
2
- VERSION = "2.5.0"
2
+ VERSION = "2.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attr_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathan Rochkind
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-11-09 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activerecord
@@ -195,7 +194,6 @@ licenses:
195
194
  metadata:
196
195
  homepage_uri: https://github.com/jrochkind/attr_json
197
196
  source_code_uri: https://github.com/jrochkind/attr_json
198
- post_install_message:
199
197
  rdoc_options: []
200
198
  require_paths:
201
199
  - lib
@@ -210,8 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
210
208
  - !ruby/object:Gem::Version
211
209
  version: '0'
212
210
  requirements: []
213
- rubygems_version: 3.2.33
214
- signing_key:
211
+ rubygems_version: 3.7.1
215
212
  specification_version: 4
216
213
  summary: ActiveRecord attributes stored serialized in a json column, super smooth.
217
214
  test_files: []