store_model 2.3.0 → 2.4.0

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: 7cd3190d949fc4fd854928abccfafa5b74658bb973e1efe1567aa7b0ab0546d8
4
- data.tar.gz: 22945765f627eca2a7278b46b3f462ee620e5721957d401a5f06b13b7daafffe
3
+ metadata.gz: 738610a630b9d60da6e855965f5f2ecfee4bb1acd68d89b8f012645f62930591
4
+ data.tar.gz: 512a83d32803641b177f9bd385f7c543595492851e96f296f7257fcc6ac8275e
5
5
  SHA512:
6
- metadata.gz: 1a740f2c00feb62259cae03b72f992dfc7ae15538010a3d62a88cf3cdcb3ab5986e20ae56d2f9133adf294ab4d25232b56216ff3f940ad8732bbef8de1dc0e56
7
- data.tar.gz: e6ad43a005026d5275fd29573ab9dbddd3d8fb966c329eb9a44f7fc2b0406cc9350725cc143daea17953e8d084d9a76b5a13d87d50b213fe0a565e3b9a2c289a
6
+ metadata.gz: 4ef1e9fab0a057edc2322593fb17595e4517c1c10c87b726c02f84deb1aabbd73a37949c885987cf9f342892d2df17675b4e18839a82f0d6153c57797930acb8
7
+ data.tar.gz: 150c9d6dc291512309046c9049316c3ad9f2784e0989751ae406dcc6924a43973b88c2c606a8645c6a25d9243816d7f0dc7470ffbe02512837db4862f783b988
data/README.md CHANGED
@@ -132,6 +132,7 @@ end
132
132
  4. [One of](./docs/one_of.md)
133
133
  4. [Alternatives](./docs/alternatives.md)
134
134
  5. [Defining custom types](./docs/defining_custom_types.md)
135
+ 6. [Disabling Parent Tracking](./docs/enable_parent_assignment.md)
135
136
 
136
137
  ## Credits
137
138
 
@@ -15,12 +15,18 @@ module StoreModel
15
15
  # @return [Boolean]
16
16
  attr_accessor :serialize_unknown_attributes
17
17
 
18
- # Controls if the result of `as_json` will serialize enum fiels using `as_json`
18
+ # Controls if the result of `as_json` will serialize enum fields using `as_json`
19
19
  # @return [Boolean]
20
20
  attr_accessor :serialize_enums_using_as_json
21
21
 
22
+ # Controls if parent tracking functionality is enabled.
23
+ # Default: true
24
+ # @return [Boolean]
25
+ attr_accessor :enable_parent_assignment
26
+
22
27
  def initialize
23
28
  @serialize_unknown_attributes = true
29
+ @enable_parent_assignment = true
24
30
  end
25
31
  end
26
32
  end
@@ -7,8 +7,10 @@ module StoreModel # :nodoc:
7
7
  class Railtie < Rails::Railtie # :nodoc:
8
8
  config.to_prepare do |_app|
9
9
  ActiveSupport.on_load(:active_record) do
10
- ActiveModel::Attributes.prepend(Attributes)
11
- prepend(Base)
10
+ if StoreModel.config.enable_parent_assignment
11
+ ActiveModel::Attributes.prepend(Attributes)
12
+ prepend(Base)
13
+ end
12
14
  end
13
15
  end
14
16
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StoreModel # :nodoc:
4
- VERSION = "2.3.0"
4
+ VERSION = "2.4.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: store_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.0
4
+ version: 2.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - DmitryTsepelev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-02 00:00:00.000000000 Z
11
+ date: 2024-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord