frozen_record 0.25.2 → 0.25.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/lib/frozen_record/base.rb +1 -1
- data/lib/frozen_record/compact.rb +1 -1
- data/lib/frozen_record/scope.rb +1 -5
- data/lib/frozen_record/version.rb +1 -1
- data/spec/frozen_record_spec.rb +7 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8fc155c1a350f49fbc79e245cc768722c9880cd0010b7829a33aea0ac55ab69
|
4
|
+
data.tar.gz: a16dde142d53022fb3b76b8262326d774342f4158b7d1ec018bf0a4879d41d77
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a315f98d4d6c79dc0ac6146715fdee499d383fc9d5e550bbdc7278655a19da2b744923ed41f7f445fc4175f575f6ea1330e77381edfe77fa5dbd4152e6446bb
|
7
|
+
data.tar.gz: d9e7d61a94c6504ecb0c3fc4e298487bfa30a5d9fd7b527657fc51259246aa23030567f676d2ff06595dca1b1de7a78281bb2380b19ae23145ccd04397dd0799
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,17 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# v0.25.5
|
4
|
+
|
5
|
+
- `FrozenRecord::Base#==` now returns `false` if the primary key is `nil` (to match the `ActiveRecord::Base` implementation)
|
6
|
+
|
7
|
+
# v0.25.4
|
8
|
+
|
9
|
+
- Minor Ruby 3.2 compatiblity fix (regarding `ruby2_keywords`).
|
10
|
+
|
11
|
+
# v0.25.3
|
12
|
+
|
13
|
+
- Also disable max_records_scan when loading `Compact` records.
|
14
|
+
|
3
15
|
# v0.25.2
|
4
16
|
|
5
17
|
- Fix FrozenRecord.ignore_max_records_scan not applying
|
data/lib/frozen_record/base.rb
CHANGED
@@ -19,7 +19,7 @@ module FrozenRecord
|
|
19
19
|
@attributes = list_attributes(records).freeze
|
20
20
|
build_attributes_cache
|
21
21
|
define_attribute_methods(@attributes.to_a)
|
22
|
-
records = records.map { |r| load(r) }.freeze
|
22
|
+
records = FrozenRecord.ignore_max_records_scan { records.map { |r| load(r) }.freeze }
|
23
23
|
index_definitions.values.each { |index| index.build(records) }
|
24
24
|
records
|
25
25
|
end
|
data/lib/frozen_record/scope.rb
CHANGED
@@ -242,17 +242,13 @@ module FrozenRecord
|
|
242
242
|
if array_delegable?(method_name)
|
243
243
|
to_a.public_send(method_name, *args, &block)
|
244
244
|
elsif @klass.respond_to?(method_name)
|
245
|
-
|
245
|
+
scoping { @klass.public_send(method_name, *args, &block) }
|
246
246
|
else
|
247
247
|
super
|
248
248
|
end
|
249
249
|
end
|
250
250
|
ruby2_keywords :method_missing if respond_to?(:ruby2_keywords, true)
|
251
251
|
|
252
|
-
def delegate_to_class(*args, &block)
|
253
|
-
scoping { @klass.public_send(*args, &block) }
|
254
|
-
end
|
255
|
-
|
256
252
|
def array_delegable?(method)
|
257
253
|
Array.method_defined?(method) && !DISALLOWED_ARRAY_METHODS.include?(method)
|
258
254
|
end
|
data/spec/frozen_record_spec.rb
CHANGED
@@ -149,6 +149,13 @@ RSpec.shared_examples 'main' do
|
|
149
149
|
expect(country).to be == second_country
|
150
150
|
end
|
151
151
|
|
152
|
+
it 'returns false if both instances are from the same class and their ids are nil' do
|
153
|
+
country = country_model.new(id: nil)
|
154
|
+
second_country = country_model.new(id: nil)
|
155
|
+
|
156
|
+
expect(country).to_not be == second_country
|
157
|
+
end
|
158
|
+
|
152
159
|
it 'returns false if both instances are not from the same class' do
|
153
160
|
country = country_model.first
|
154
161
|
car = car_model.new(id: country.id)
|
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.25.
|
4
|
+
version: 0.25.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Boussier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-06-
|
11
|
+
date: 2022-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
- !ruby/object:Gem::Version
|
138
138
|
version: '0'
|
139
139
|
requirements: []
|
140
|
-
rubygems_version: 3.
|
140
|
+
rubygems_version: 3.1.2
|
141
141
|
signing_key:
|
142
142
|
specification_version: 4
|
143
143
|
summary: ActiveRecord like interface to read only access and query static YAML files
|