frozen_record 0.27.2 → 0.27.4

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: e47fc697be74381e4202860b94854c7634c3dbf689cf32acbe57d5c15bed9f83
4
- data.tar.gz: 3e78652cd4102592513af618648f555bd936a96c97a71a9cc9af6a33bebd0d74
3
+ metadata.gz: d790a4c35575afe0294cdcaa88f0f75bdee110623f40bfddd1ea4edade4df7c0
4
+ data.tar.gz: 0c5e6cd922365269c4a320a92c7b196749ce2016f5a8bdeb887bdc191a83ebcf
5
5
  SHA512:
6
- metadata.gz: d04577bfa1b97b5a0ada49555147cac4ce31c39187e10acf2e0367c80d00a224f0a5d2ec36d350775d92417fb92b6bfc67fa99c859a01628844805121c9a91e4
7
- data.tar.gz: bfeed5194bd51706fae613df484de29f8629a314947e96c4abc6b65b1ce7b2eab26d950760c78368daa752b6ae8e1692d21d7383f493ac5a972f3f24049018a3
6
+ metadata.gz: af254fb45c82cd57300fd613b513f1e423f102dc9dd3ddc5a2c99f0abd4b44cbd72b104b471795c8e1b9e91cda27d27760eea30fde2c682caef91b5ef1cc30e9
7
+ data.tar.gz: db4fd7fc5e5d5f00566a246b29ba8c0f337bfbf7043b6925ce7492ac7862372f4098c85f341b6b01672de47345055b10a9269f691fb2d9f0ee0623d2d8425799
data/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # Unreleased
2
2
 
3
+ # v0.27.4
4
+
5
+ - Also fix compatibility with Rails 8.0.0alpha: https://github.com/rails/rails/pull/52717. Missed a few places.
6
+
7
+ # v0.27.3
8
+
9
+ - Fix compatibility with Rails 8.0.0alpha: https://github.com/rails/rails/pull/52717
10
+
3
11
  # v0.27.2
4
12
 
5
13
  - Fix a Ruby warning that was emitted when `frozen_record` is loaded.
@@ -28,17 +28,13 @@ module FrozenRecord
28
28
  FIND_BY_PATTERN = /\Afind_by_(\w+)(!?)/
29
29
  FALSY_VALUES = [false, nil, 0, -''].to_set
30
30
 
31
- class_attribute :base_path, :primary_key, :backend, :auto_reloading, :default_attributes, instance_accessor: false
31
+ class_attribute :base_path, :_primary_key, :backend, :auto_reloading, :_default_attributes, instance_accessor: false
32
32
  class_attribute :index_definitions, instance_accessor: false
33
33
  class_attribute :attribute_deserializers, instance_accessor: false
34
34
  class_attribute :max_records_scan, instance_accessor: false
35
35
  self.index_definitions = {}.freeze
36
36
  self.attribute_deserializers = {}.freeze
37
37
 
38
- self.primary_key = 'id'
39
-
40
- self.backend = FrozenRecord::Backends::Yaml
41
-
42
38
  attribute_method_suffix '?'
43
39
 
44
40
  class ThreadSafeStorage
@@ -68,23 +64,20 @@ module FrozenRecord
68
64
  self.max_records_scan = previous_max_records_scan
69
65
  end
70
66
 
71
- alias_method :set_default_attributes, :default_attributes=
72
- private :set_default_attributes
67
+ def default_attributes
68
+ _default_attributes
69
+ end
70
+
73
71
  def default_attributes=(default_attributes)
74
- set_default_attributes(default_attributes.transform_keys(&:to_s))
72
+ self._default_attributes = default_attributes.transform_keys(&:to_s)
75
73
  end
76
74
 
77
- alias_method :set_primary_key, :primary_key=
78
- private :set_primary_key
79
- def primary_key=(primary_key)
80
- set_primary_key(-primary_key.to_s)
75
+ def primary_key
76
+ _primary_key
81
77
  end
82
78
 
83
- alias_method :set_base_path, :base_path=
84
- private :set_base_path
85
- def base_path=(base_path)
86
- @file_path = nil
87
- set_base_path(base_path)
79
+ def primary_key=(primary_key)
80
+ self._primary_key = -primary_key.to_s
88
81
  end
89
82
 
90
83
  attr_accessor :abstract_class
@@ -115,13 +108,11 @@ module FrozenRecord
115
108
 
116
109
  def file_path
117
110
  raise ArgumentError, "You must define `#{name}.base_path`" unless base_path
118
- @file_path ||= begin
119
- file_path = File.join(base_path, backend.filename(name))
120
- if !File.exist?(file_path) && File.exist?("#{file_path}.erb")
121
- "#{file_path}.erb"
122
- else
123
- file_path
124
- end
111
+ file_path = File.join(base_path, backend.filename(name))
112
+ if !File.exist?(file_path) && File.exist?("#{file_path}.erb")
113
+ "#{file_path}.erb"
114
+ else
115
+ file_path
125
116
  end
126
117
  end
127
118
 
@@ -283,6 +274,10 @@ module FrozenRecord
283
274
 
284
275
  end
285
276
 
277
+ self.primary_key = 'id'
278
+
279
+ self.backend = FrozenRecord::Backends::Yaml
280
+
286
281
  def initialize(attrs = {})
287
282
  @attributes = attrs.freeze
288
283
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FrozenRecord
4
- VERSION = '0.27.2'
4
+ VERSION = '0.27.4'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: frozen_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.2
4
+ version: 0.27.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-01 00:00:00.000000000 Z
11
+ date: 2024-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements: []
128
- rubygems_version: 3.5.9
128
+ rubygems_version: 3.5.17
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: ActiveRecord like interface to read only access and query static YAML files