activejsonmodel 0.1.2 → 0.1.3

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: 1f2bf815c387423461ead46e38e315eb8ad0c866f4745ae9d67882a36e7e0b0c
4
- data.tar.gz: 59abf0fbc153f61787fd422962e5f23c74d69276de65d0483d82b3b8b1d618ac
3
+ metadata.gz: f12f2a8c7d4739513ed25aa68753babdcee91046a61bbb853be921f6886d34ea
4
+ data.tar.gz: 977442b81243736fb2fe2ecec108d1e2abfcc4d24c5a2e0a0df24cad388a731e
5
5
  SHA512:
6
- metadata.gz: db6f3794674d502cdc6ffc2b7c25e23e93685cb1255eba0c5a42fb3b431f170b6e70b874d630eaa3319a5a4f81660aa24ab4141b92f864f2a478f5931f67a660
7
- data.tar.gz: 8ca90836a7bae3ef2cc78bfe10035486c3612fc3f6c8117568320de1082b0b447fb08d4cc909e23253328396b336e0a194b98db9c0d4a5c421737106186df42d
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
- activejsonmodel x.x.x built to pkg/activejsonmodel-x.x.x.gem.
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: activejsonmodel (x.x.x)
222
- Pushed activejsonmodel x.x.x to rubygems.org
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
 
@@ -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 ||= ActiveModelJsonSerializableType.new(self)
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 ||= ActiveModelJsonSerializableEncryptedType.new(self)
256
+ @encrypted_attribute_type ||= ActiveRecordEncryptedType.new(self)
257
257
  end
258
258
  end
259
259
 
@@ -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 ||= ActiveModelJsonSerializableType.new(self)
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 ||= ActiveModelJsonSerializableEncryptedType.new(self)
293
+ @encrypted_attribute_type ||= ActiveRecordEncryptedType.new(self)
294
294
  end
295
295
  end
296
296
 
File without changes
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveJsonModel
4
- VERSION = "0.1.2".freeze
4
+ VERSION = "0.1.3".freeze
5
5
  end
@@ -1,8 +1,11 @@
1
1
  require 'active_model'
2
+ require "active_support"
2
3
 
3
4
  module ActiveJsonModel
4
- autoload :VERSION, "activejsonmodel/version"
5
- autoload :Model, "activejsonmodel/model"
6
- autoload :Array, "activejsonmodel/array"
7
- autoload :Utils, "activejsonmodel/utils"
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
@@ -0,0 +1,4 @@
1
+ # This file is here to make sure Rail's autoloading of gems works
2
+ # When requiring manually, use:
3
+ # require 'active_json_model'
4
+ require_relative './active_json_model'
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.2
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-08-22 00:00:00.000000000 Z
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/activejsonmodel/active_record_encrypted_type.rb
64
- - lib/activejsonmodel/active_record_type.rb
65
- - lib/activejsonmodel/after_load_callback.rb
66
- - lib/activejsonmodel/array.rb
67
- - lib/activejsonmodel/json_attribute.rb
68
- - lib/activejsonmodel/model.rb
69
- - lib/activejsonmodel/utils.rb
70
- - lib/activejsonmodel/version.rb
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