attr_json 2.0.0.rc1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +6 -0
- data/Appraisals +12 -0
- data/CHANGELOG.md +18 -3
- data/README.md +9 -2
- data/gemfiles/rails_6_0.gemfile +2 -2
- data/gemfiles/rails_6_1.gemfile +2 -2
- data/gemfiles/rails_7_0.gemfile +2 -2
- data/gemfiles/rails_edge.gemfile +5 -2
- data/lib/attr_json/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 979ced874e097dcf41e911b60320b8cf05dde0a3fce0256b7127d0ad28de4854
|
4
|
+
data.tar.gz: cfa4e62ba695c5f952adcef69a47453781891f91e854bbe83cf83d4360364773
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 054c84ddcd6d63b3020656ba64a200c43a8994d28be693a61d37dee5a25352b215e375354ca55ea3cd8f3e80b6427639ba279d2075a52aaa9f9b7a4364506d75
|
7
|
+
data.tar.gz: f2fe2af4a190f7e6c7fe18f2fff235158f209929a0ded8d66543833b8d8b2ca55b93dece3363f71b93000e4c174c48ce3516ab291948dad88b109d0d973987a5
|
data/.github/workflows/ci.yml
CHANGED
data/Appraisals
CHANGED
@@ -3,6 +3,7 @@ appraise "rails-6-0" do
|
|
3
3
|
|
4
4
|
gem "rails", ">= 6.0.0", "< 6.1"
|
5
5
|
gem "pg", "~> 1.0"
|
6
|
+
gem "rspec-rails", "~> 5.0"
|
6
7
|
end
|
7
8
|
|
8
9
|
appraise "rails-6-1" do
|
@@ -32,4 +33,15 @@ appraise "rails-edge" do
|
|
32
33
|
|
33
34
|
gem "rails", git: "https://github.com/rails/rails.git", branch: "main"
|
34
35
|
gem "pg", "~> 1.0"
|
36
|
+
|
37
|
+
# Edge rails, future Rails 7.1 currently allows rack 3 -- but rails itself
|
38
|
+
# and some of our other dependencies may not actually work with rack 3 yet,
|
39
|
+
# let's test under rack 2. (Nothing in this gem deals with levels as low as rack)
|
40
|
+
#
|
41
|
+
# Bundler was having trouble resolving unless we specified rackup and rack-session
|
42
|
+
# limits too, I think it was a bundler failure, we actually only care about
|
43
|
+
# rack < 3 here.
|
44
|
+
gem "rack", "~> 2.0"
|
45
|
+
gem "rackup", "< 2"
|
46
|
+
gem "rack-session", "< 2"
|
35
47
|
end
|
data/CHANGELOG.md
CHANGED
@@ -4,13 +4,28 @@ Notable changes to this project will be documented in this file.
|
|
4
4
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
5
5
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
6
6
|
|
7
|
-
## [Unreleased](https://github.com/jrochkind/attr_json/compare/
|
7
|
+
## [Unreleased](https://github.com/jrochkind/attr_json/compare/v2.0.0...HEAD)
|
8
8
|
|
9
|
+
### Changed
|
10
|
+
|
11
|
+
*
|
12
|
+
|
13
|
+
*
|
14
|
+
|
15
|
+
*
|
16
|
+
|
17
|
+
### Added
|
18
|
+
|
19
|
+
*
|
20
|
+
|
21
|
+
*
|
22
|
+
|
23
|
+
*
|
9
24
|
|
10
25
|
|
11
|
-
## [
|
26
|
+
## [2.0.0](https://github.com/jrochkind/attr_json/compare/v1.5.0...v2.0.0)
|
12
27
|
|
13
|
-
While it has some backwards incompat changes, this is expected not to be a challenging upgrade, please let us know by filing an issue if it's giving you troubles, maybe we can make things easier for you. No changes to data stored in your DB should be needed when upgrading, the persisted data should be compatible between
|
28
|
+
While it has some backwards incompat changes, this is expected not to be a challenging upgrade, please let us know by filing an issue if it's giving you troubles, maybe we can make things easier for you. No changes to data stored in your DB should be needed when upgrading, the persisted data should be compatible between 1.x and 2.x.
|
14
29
|
|
15
30
|
### Removed
|
16
31
|
|
data/README.md
CHANGED
@@ -256,6 +256,11 @@ m.attr_jsons_before_type_cast
|
|
256
256
|
|
257
257
|
You can nest AttrJson::Model objects inside each other, as deeply as you like.
|
258
258
|
|
259
|
+
You *can* edit nested models "in place", they will be properly saved.
|
260
|
+
|
261
|
+
m.lang_and_value.lang = "de"
|
262
|
+
m.save! # no problem!
|
263
|
+
|
259
264
|
For use with Rails forms, you may want to use `attr_json_accepts_nested_attributes_for` (like Rails `accepts_nested_attributes_for`, see doc page on [Use with Forms and Form Builders](https://github.com/jrochkind/attr_json/blob/master/doc_src/forms.md).
|
260
265
|
|
261
266
|
### Model-type defaults
|
@@ -541,9 +546,9 @@ We use [appraisal](https://github.com/thoughtbot/appraisal) to test with multipl
|
|
541
546
|
|
542
547
|
There is a `./bin/console` that will give you a console in the context of attr_json and all it's dependencies, including the combustion rails app, and the models defined there.
|
543
548
|
|
544
|
-
## Acknowledements
|
549
|
+
## Acknowledements, Prior Art, alternatives
|
545
550
|
|
546
|
-
* The excellent work [
|
551
|
+
* The excellent work [sgrif](https://twitter.com/sgrif) did on ActiveModel::Type
|
547
552
|
really lays the groundwork and makes this possible. Plus many other Rails developers.
|
548
553
|
Rails has a reputation for being composed of messy or poorly designed code, but
|
549
554
|
it's some really nice design in Rails that allows us to do some pretty powerful
|
@@ -563,3 +568,5 @@ There is a `./bin/console` that will give you a console in the context of attr_j
|
|
563
568
|
haven't looked at it too much.
|
564
569
|
|
565
570
|
* [store_model](https://github.com/DmitryTsepelev/store_model) was created after `attr_json`, and has some overlapping functionality.
|
571
|
+
|
572
|
+
* [store_attribute](https://github.com/palkan/store_attribute) is also a more recent addition. while it's not specifically about JSON, it could be used with an underlying JSON coder to give you typed json attributes.
|
data/gemfiles/rails_6_0.gemfile
CHANGED
@@ -5,14 +5,14 @@ source "https://rubygems.org"
|
|
5
5
|
gem "combustion", "~> 1.0"
|
6
6
|
gem "rails", ">= 6.0.0", "< 6.1"
|
7
7
|
gem "pg", "~> 1.0"
|
8
|
-
gem "rspec-rails", "~>
|
8
|
+
gem "rspec-rails", "~> 5.0"
|
9
9
|
gem "simple_form", ">= 4.0"
|
10
10
|
gem "cocoon", ">= 1.2"
|
11
11
|
gem "jquery-rails"
|
12
12
|
gem "coffee-rails"
|
13
13
|
gem "sprockets-rails"
|
14
14
|
gem "capybara", "~> 3.0"
|
15
|
-
gem "webdrivers", "~>
|
15
|
+
gem "webdrivers", "~> 5.0"
|
16
16
|
gem "selenium-webdriver"
|
17
17
|
gem "byebug"
|
18
18
|
|
data/gemfiles/rails_6_1.gemfile
CHANGED
@@ -5,14 +5,14 @@ source "https://rubygems.org"
|
|
5
5
|
gem "combustion", "~> 1.0"
|
6
6
|
gem "rails", "~> 6.1.0"
|
7
7
|
gem "pg", "~> 1.0"
|
8
|
-
gem "rspec-rails", "~>
|
8
|
+
gem "rspec-rails", "~> 6.0"
|
9
9
|
gem "simple_form", ">= 4.0"
|
10
10
|
gem "cocoon", ">= 1.2"
|
11
11
|
gem "jquery-rails"
|
12
12
|
gem "coffee-rails"
|
13
13
|
gem "sprockets-rails"
|
14
14
|
gem "capybara", "~> 3.0"
|
15
|
-
gem "webdrivers", "~>
|
15
|
+
gem "webdrivers", "~> 5.0"
|
16
16
|
gem "selenium-webdriver"
|
17
17
|
gem "byebug"
|
18
18
|
|
data/gemfiles/rails_7_0.gemfile
CHANGED
@@ -5,14 +5,14 @@ source "https://rubygems.org"
|
|
5
5
|
gem "combustion", "~> 1.0"
|
6
6
|
gem "rails", "~> 7.0.0"
|
7
7
|
gem "pg", "~> 1.0"
|
8
|
-
gem "rspec-rails", "~>
|
8
|
+
gem "rspec-rails", "~> 6.0"
|
9
9
|
gem "simple_form", ">= 4.0"
|
10
10
|
gem "cocoon", ">= 1.2"
|
11
11
|
gem "jquery-rails"
|
12
12
|
gem "coffee-rails"
|
13
13
|
gem "sprockets-rails"
|
14
14
|
gem "capybara", "~> 3.0"
|
15
|
-
gem "webdrivers", "~>
|
15
|
+
gem "webdrivers", "~> 5.0"
|
16
16
|
gem "selenium-webdriver"
|
17
17
|
gem "byebug"
|
18
18
|
|
data/gemfiles/rails_edge.gemfile
CHANGED
@@ -5,15 +5,18 @@ source "https://rubygems.org"
|
|
5
5
|
gem "combustion", "~> 1.0", github: "pat/combustion"
|
6
6
|
gem "rails", git: "https://github.com/rails/rails.git", branch: "main"
|
7
7
|
gem "pg", "~> 1.0"
|
8
|
-
gem "rspec-rails", "~>
|
8
|
+
gem "rspec-rails", "~> 6.0"
|
9
9
|
gem "simple_form", ">= 4.0"
|
10
10
|
gem "cocoon", ">= 1.2"
|
11
11
|
gem "jquery-rails"
|
12
12
|
gem "coffee-rails"
|
13
13
|
gem "sprockets-rails"
|
14
14
|
gem "capybara", "~> 3.0"
|
15
|
-
gem "webdrivers", "~>
|
15
|
+
gem "webdrivers", "~> 5.0"
|
16
16
|
gem "selenium-webdriver"
|
17
17
|
gem "byebug"
|
18
|
+
gem "rack", "~> 2.0"
|
19
|
+
gem "rackup", "< 2"
|
20
|
+
gem "rack-session", "< 2"
|
18
21
|
|
19
22
|
gemspec path: "../"
|
data/lib/attr_json/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attr_json
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.0
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonathan Rochkind
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -202,11 +202,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
202
202
|
version: 2.6.0
|
203
203
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
204
204
|
requirements:
|
205
|
-
- - "
|
205
|
+
- - ">="
|
206
206
|
- !ruby/object:Gem::Version
|
207
|
-
version:
|
207
|
+
version: '0'
|
208
208
|
requirements: []
|
209
|
-
rubygems_version: 3.
|
209
|
+
rubygems_version: 3.4.5
|
210
210
|
signing_key:
|
211
211
|
specification_version: 4
|
212
212
|
summary: ActiveRecord attributes stored serialized in a json column, super smooth.
|