jsonb_accessor 1.3.4 → 1.3.5

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: b3b40b7c775b9275c1fe7b6f3f3a8c0b7988dcd995da1b5bd594d0c3469ca372
4
- data.tar.gz: 68dcf83030c07a537adee9030fd0f209f276e1e80f118c2d3ecc982694be466b
3
+ metadata.gz: 2108495d2442f1905215251c560bcfc55a2db8df2399dddc17bce90df225137c
4
+ data.tar.gz: da3adfd2362f45ce87f56bb85d0cf1f75d8ceb673ce4a59c45216c37e730ac1c
5
5
  SHA512:
6
- metadata.gz: 9a136d5a27d25f8ffb29e2f2f06ffb43417b91544836dda70dd40583786512d29d302251c39eb877772e382da5ef4af28afc970a31ae295b5d01933d5f5e33bd
7
- data.tar.gz: 411147569acaf3f9052e4ccae17063b3b0eaeb00c2738933a520a635861b054889b31b534b8959ae5d38bc3f5709dc0c3ccc9b20f45cf0f1f066b0aa60469e77
6
+ metadata.gz: a4747333700d55aec57b35a3c6ee1538e0f400f0d32ff126f2b5634c3faad15d5c4e240d234a65197bda8f30f53149dd9aca9f6598e03a7dd8752d9cadd5c583
7
+ data.tar.gz: 68745180a1a9fc646062225b0eb64b0b576ccb6d32f1243881445d5ec7082113dc97e2825349a635db530cd69cd1d11b92363ef90e2ee147a41fd3e3147de835
@@ -11,12 +11,13 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v2
14
-
14
+
15
15
  - name: Set up Ruby
16
16
  uses: ruby/setup-ruby@v1
17
17
  with:
18
18
  ruby-version: 2.7.2
19
19
  bundler-cache: true
20
+
20
21
  - name: Rubocop
21
22
  run: bundle exec rubocop
22
23
 
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
  ## [Unreleased]
3
3
 
4
+ ## [1.3.5] - 2022-07-23
5
+ ### Fixed
6
+
7
+ - Bug fix: Attributes defined outside of jsonb_accessor are not written [#149](https://github.com/madeintandem/jsonb_accessor/pull/149)
8
+
4
9
  ## [1.3.4] - 2022-02-02
5
10
  ### Fixed
6
11
 
data/README.md CHANGED
@@ -25,7 +25,7 @@ It also adds generic scopes for querying `jsonb` columns.
25
25
  Add this line to your application's `Gemfile`:
26
26
 
27
27
  ```ruby
28
- gem "jsonb_accessor", "~> 1"
28
+ gem "jsonb_accessor"
29
29
  ```
30
30
 
31
31
  And then execute:
@@ -91,9 +91,8 @@ module JsonbAccessor
91
91
 
92
92
  empty_named_attributes = names_to_store_keys.transform_values { nil }
93
93
  empty_named_attributes.merge(value_with_named_keys).each do |name, attribute_value|
94
- # Undefined keys: There might be things in the JSON that haven't been defined using jsonb_accessor
95
- # It should still be possible to save arbitrary data in the JSON
96
- next unless has_attribute? name
94
+ # Only proceed if this attribute has been defined using `jsonb_accessor`.
95
+ next unless names_to_store_keys.key?(name)
97
96
 
98
97
  write_attribute(name, attribute_value)
99
98
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonbAccessor
4
- VERSION = "1.3.4"
4
+ VERSION = "1.3.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonb_accessor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Crismali
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-02-02 00:00:00.000000000 Z
13
+ date: 2022-07-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord