elasticsearch_record 5.0.0 → 5.0.1
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:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cef7d68e9ae9718034159014687d3f5237a473cb63b0ec00d0db8e2db17e4fa6
|
|
4
|
+
data.tar.gz: 6de7559f4e5711be72fe942e1fbfdccc6b316e4b958678377173b6e03037b67c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8bd4dc770aad866810a674bfb5e91cce295f5659189d73315fe558a9309ffe73c15c7bdeba0b94bcf923058ebcd5d2e33f4652f064a343d4d2cc97a75644c205
|
|
7
|
+
data.tar.gz: abff63bee87a65d7ecb7b9ee26a6063ee812d103f3ff5dcbca90f927e45d052ffdf8ab68950ba7667b27a88296504ee1cd6696ba497cb6944c11a32566f494a7
|
data/docs/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# ElasticsearchRecord - CHANGELOG
|
|
2
2
|
|
|
3
|
+
## [5.0.1] - 2026-09-16
|
|
4
|
+
* [add] specs for `Elasticsearch::Column` identity, deduplication & YAML round-trip
|
|
5
|
+
* [fix] `Elasticsearch::Column#==`, `#eql?` & `#hash` also compare `virtual`, `fields`, `properties`, `meta` & `enabled` - same-named columns of different indexes no longer share a single deduplicated object
|
|
6
|
+
* [fix] `Elasticsearch::Column#init_with` & `#encode_with` serialize the elasticsearch-specific attributes
|
|
7
|
+
|
|
3
8
|
## [5.0.0] - 2026-09-10
|
|
4
9
|
* [add] **BREAKING**: requires `activerecord ~> 8.1.0`
|
|
5
10
|
* [add] `Relation::ValueMethods#limit!` - keeps the `'__max__'` & `Float::INFINITY` limits, which rails now casts through `Integer()`
|
|
@@ -22,6 +22,53 @@ module ActiveRecord
|
|
|
22
22
|
meta? && meta['comment']
|
|
23
23
|
end
|
|
24
24
|
|
|
25
|
+
def init_with(coder)
|
|
26
|
+
@virtual = coder['virtual']
|
|
27
|
+
@fields = coder['fields']
|
|
28
|
+
@properties = coder['properties']
|
|
29
|
+
@meta = coder['meta']
|
|
30
|
+
@enabled = coder['enabled']
|
|
31
|
+
super
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def encode_with(coder)
|
|
35
|
+
coder['virtual'] = @virtual
|
|
36
|
+
coder['fields'] = @fields
|
|
37
|
+
coder['properties'] = @properties
|
|
38
|
+
coder['meta'] = @meta
|
|
39
|
+
coder['enabled'] = @enabled
|
|
40
|
+
super
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
# ActiveRecord deduplicates columns process-wide through +Deduplicable+, which
|
|
44
|
+
# keys its registry by +#hash+ & +#eql?+ - so columns that only differ in the
|
|
45
|
+
# elasticsearch-specific attributes must NOT compare equal.
|
|
46
|
+
# Without this a +keyword+ column with a +analyzed+ sub-field would share the
|
|
47
|
+
# object of a same-named +keyword+ column without any fields - whichever index
|
|
48
|
+
# loaded its schema first wins & the other one silently gains or loses its
|
|
49
|
+
# +fields+ (breaking e.g. +where('code.analyzed' => ...)+).
|
|
50
|
+
def ==(other)
|
|
51
|
+
other.is_a?(Column) &&
|
|
52
|
+
super &&
|
|
53
|
+
virtual == other.virtual &&
|
|
54
|
+
fields == other.fields &&
|
|
55
|
+
properties == other.properties &&
|
|
56
|
+
meta == other.meta &&
|
|
57
|
+
enabled == other.enabled
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
alias :eql? :==
|
|
61
|
+
|
|
62
|
+
def hash
|
|
63
|
+
Column.hash ^
|
|
64
|
+
super.hash ^
|
|
65
|
+
virtual.hash ^
|
|
66
|
+
fields.hash ^
|
|
67
|
+
properties.hash ^
|
|
68
|
+
meta.hash ^
|
|
69
|
+
enabled.hash
|
|
70
|
+
end
|
|
71
|
+
|
|
25
72
|
# returns true if this column is enabled (= searchable by queries)
|
|
26
73
|
# @return [Boolean]
|
|
27
74
|
def enabled?
|