activejsonmodel 0.1.2 → 0.1.3
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 +3 -3
- data/lib/{activejsonmodel → active_json_model}/active_record_encrypted_type.rb +0 -0
- data/lib/{activejsonmodel → active_json_model}/active_record_type.rb +0 -0
- data/lib/{activejsonmodel → active_json_model}/after_load_callback.rb +0 -0
- data/lib/{activejsonmodel → active_json_model}/array.rb +2 -2
- data/lib/{activejsonmodel → active_json_model}/json_attribute.rb +0 -0
- data/lib/{activejsonmodel → active_json_model}/model.rb +2 -2
- data/lib/{activejsonmodel → active_json_model}/utils.rb +0 -0
- data/lib/{activejsonmodel → active_json_model}/version.rb +1 -1
- data/lib/active_json_model.rb +7 -4
- data/lib/activejsonmodel.rb +4 -0
- metadata +17 -11
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f12f2a8c7d4739513ed25aa68753babdcee91046a61bbb853be921f6886d34ea
|
|
4
|
+
data.tar.gz: 977442b81243736fb2fe2ecec108d1e2abfcc4d24c5a2e0a0df24cad388a731e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: be403bfb95151340f132ed221037c95f814c0c8b7ad056ed3bac3425b31034d76cc20ac798a29eb512d6eed5bdf7c2b755dc8341c553ba383ab7c760b75ff8e7
|
|
7
|
+
data.tar.gz: a8c6ffe2e5e4f67c0835e068a0b45355f2f76681e94e068f7123c5b684a8f4f7f7cefb764fc4b1a8806c1544a5091444efe04afb55c8d04e0656a93eb03a1ee7
|
data/README.md
CHANGED
|
@@ -214,12 +214,12 @@ end
|
|
|
214
214
|
|
|
215
215
|
```bash
|
|
216
216
|
$ rake release
|
|
217
|
-
|
|
217
|
+
active_json_model x.x.x built to pkg/active_json_model-x.x.x.gem.
|
|
218
218
|
Tagged vx.x.x.
|
|
219
219
|
Pushed git commits and release tag.
|
|
220
220
|
Pushing gem to https://rubygems.org...
|
|
221
|
-
Successfully registered gem:
|
|
222
|
-
Pushed
|
|
221
|
+
Successfully registered gem: active_json_model (x.x.x)
|
|
222
|
+
Pushed active_json_model x.x.x to rubygems.org
|
|
223
223
|
Don't forget to publish the release on GitHub!
|
|
224
224
|
```
|
|
225
225
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -238,7 +238,7 @@ module ActiveJsonModel
|
|
|
238
238
|
#
|
|
239
239
|
# Note that this array_data would be stored as jsonb in the database
|
|
240
240
|
def attribute_type
|
|
241
|
-
@attribute_type ||=
|
|
241
|
+
@attribute_type ||= ActiveRecordType.new(self)
|
|
242
242
|
end
|
|
243
243
|
|
|
244
244
|
# Allow this model to be used as ActiveRecord attribute type in Rails 5+.
|
|
@@ -253,7 +253,7 @@ module ActiveJsonModel
|
|
|
253
253
|
# Note that this array_data would be stored as a string in the database, encrypted using
|
|
254
254
|
# a symmetric key at the application level.
|
|
255
255
|
def encrypted_attribute_type
|
|
256
|
-
@encrypted_attribute_type ||=
|
|
256
|
+
@encrypted_attribute_type ||= ActiveRecordEncryptedType.new(self)
|
|
257
257
|
end
|
|
258
258
|
end
|
|
259
259
|
|
|
File without changes
|
|
@@ -275,7 +275,7 @@ module ActiveJsonModel
|
|
|
275
275
|
#
|
|
276
276
|
# Note that this data would be stored as jsonb in the database
|
|
277
277
|
def attribute_type
|
|
278
|
-
@attribute_type ||=
|
|
278
|
+
@attribute_type ||= ActiveRecordType.new(self)
|
|
279
279
|
end
|
|
280
280
|
|
|
281
281
|
# Allow this model to be used as ActiveRecord attribute type in Rails 5+.
|
|
@@ -290,7 +290,7 @@ module ActiveJsonModel
|
|
|
290
290
|
# Note that this data would be stored as a string in the database, encrypted using
|
|
291
291
|
# a symmetric key at the application level.
|
|
292
292
|
def encrypted_attribute_type
|
|
293
|
-
@encrypted_attribute_type ||=
|
|
293
|
+
@encrypted_attribute_type ||= ActiveRecordEncryptedType.new(self)
|
|
294
294
|
end
|
|
295
295
|
end
|
|
296
296
|
|
|
File without changes
|
data/lib/active_json_model.rb
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
require 'active_model'
|
|
2
|
+
require "active_support"
|
|
2
3
|
|
|
3
4
|
module ActiveJsonModel
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
autoload :
|
|
7
|
-
autoload :
|
|
5
|
+
extend ActiveSupport::Autoload
|
|
6
|
+
|
|
7
|
+
autoload :VERSION, "active_json_model/version"
|
|
8
|
+
autoload :Model, "active_json_model/model"
|
|
9
|
+
autoload :Array, "active_json_model/array"
|
|
10
|
+
autoload :Utils, "active_json_model/utils"
|
|
8
11
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: activejsonmodel
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Morlok
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2022-
|
|
11
|
+
date: 2022-09-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activemodel
|
|
@@ -50,7 +50,12 @@ dependencies:
|
|
|
50
50
|
- - "<"
|
|
51
51
|
- !ruby/object:Gem::Version
|
|
52
52
|
version: '7.1'
|
|
53
|
-
description:
|
|
53
|
+
description: |
|
|
54
|
+
A library for creating Active Models that can serialize/deserialize to JSON. This includes full support for validation
|
|
55
|
+
and change detection through nested models. You can write polymorphic models or arrays of models and get full support
|
|
56
|
+
for natural serialization.
|
|
57
|
+
|
|
58
|
+
Active JSON Model can optionally be combined with Active Record to create nested child models via JSON/JSONB columns.
|
|
54
59
|
email:
|
|
55
60
|
- ryan.morlok@morlok.com
|
|
56
61
|
executables: []
|
|
@@ -60,14 +65,15 @@ files:
|
|
|
60
65
|
- LICENSE.txt
|
|
61
66
|
- README.md
|
|
62
67
|
- lib/active_json_model.rb
|
|
63
|
-
- lib/
|
|
64
|
-
- lib/
|
|
65
|
-
- lib/
|
|
66
|
-
- lib/
|
|
67
|
-
- lib/
|
|
68
|
-
- lib/
|
|
69
|
-
- lib/
|
|
70
|
-
- lib/
|
|
68
|
+
- lib/active_json_model/active_record_encrypted_type.rb
|
|
69
|
+
- lib/active_json_model/active_record_type.rb
|
|
70
|
+
- lib/active_json_model/after_load_callback.rb
|
|
71
|
+
- lib/active_json_model/array.rb
|
|
72
|
+
- lib/active_json_model/json_attribute.rb
|
|
73
|
+
- lib/active_json_model/model.rb
|
|
74
|
+
- lib/active_json_model/utils.rb
|
|
75
|
+
- lib/active_json_model/version.rb
|
|
76
|
+
- lib/activejsonmodel.rb
|
|
71
77
|
homepage: https://github.com/rmorlok/activejsonmodel
|
|
72
78
|
licenses:
|
|
73
79
|
- MIT
|