frozen_record 0.19.1 → 0.19.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/frozen_record/base.rb +2 -1
- data/lib/frozen_record/index.rb +1 -1
- data/lib/frozen_record/version.rb +1 -1
- 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: 501a982beb96747b9e2dfd6250e9685e73ffbb2932cb5fddb84b7b44f778c3dd
|
4
|
+
data.tar.gz: 9396c1416991e6a932d8a16fa430471c531281be58e8547af8a1900ebf68d4cc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: be0b8317169536a900a01769866f5b7b181974ed24dfd812abcfbd5b332324da1d8d9870c80c89af50bb3fa1565342a5e1229b198b8b6fc141d93c237566a152
|
7
|
+
data.tar.gz: 3a4c490e06150033c098905817842e6c2cc9b2719262f28f53e063de34815236910e18da5cf3e9848f4aed1e1db2e738d2b33dcce90f429fa1cdba2840cf4556
|
data/lib/frozen_record/base.rb
CHANGED
@@ -21,7 +21,8 @@ module FrozenRecord
|
|
21
21
|
FALSY_VALUES = [false, nil, 0, -''].to_set
|
22
22
|
|
23
23
|
class_attribute :base_path, :primary_key, :backend, :auto_reloading, :default_attributes, instance_accessor: false
|
24
|
-
class_attribute :index_definitions, instance_accessor: false
|
24
|
+
class_attribute :index_definitions, instance_accessor: false
|
25
|
+
self.index_definitions = {}.freeze
|
25
26
|
|
26
27
|
self.primary_key = 'id'
|
27
28
|
|
data/lib/frozen_record/index.rb
CHANGED
@@ -67,7 +67,7 @@ module FrozenRecord
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def build(records)
|
70
|
-
@index = records.
|
70
|
+
@index = records.each_with_object({}) { |r, index| index[r[attribute]] = r }
|
71
71
|
if @index.size != records.size
|
72
72
|
raise AttributeNonUnique, "#{model}##{attribute.inspect} is not unique."
|
73
73
|
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.19.
|
4
|
+
version: 0.19.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean Boussier
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -156,7 +156,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
156
|
- !ruby/object:Gem::Version
|
157
157
|
version: '0'
|
158
158
|
requirements: []
|
159
|
-
rubygems_version: 3.
|
159
|
+
rubygems_version: 3.0.2
|
160
160
|
signing_key:
|
161
161
|
specification_version: 4
|
162
162
|
summary: ActiveRecord like interface to read only access and query static YAML files
|