create_custom_attributes 0.5.11 → 0.5.12

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
  SHA1:
3
- metadata.gz: e73cb608cfca9300a1b49c35afe7b5909934b4c7
4
- data.tar.gz: 8c84c20142585753284b3de286d5cfef8e31a51f
3
+ metadata.gz: 0445ce94c2b0d7cb72b52f3962f73ba59aef43f4
4
+ data.tar.gz: a3e22072e9f332e88219ed67f2b4a08f106d6202
5
5
  SHA512:
6
- metadata.gz: 68e1a8bbc034bab7a1397acdaa5b7baff57eb205f99b8f5062494cf1ae020d403402d0f587465e4a402940f99dba67eda45dd0b977d4caf0260cf296b18ee628
7
- data.tar.gz: 2e1b7e4f2eaee259de1305a142b24a422f229a2c69ebc731dee165555e9d039cf6687fb925d1a5f45116df4ed41def15db3814bc8174354f8a2279be82705048
6
+ metadata.gz: fe1d4d5d02a055d40c58e5c5ff802362a1c2acb791216c0887212960c71fbcf719ed0728f3b10149f6eb48832689f1f3157e0dd89fae5aeab7d203dde943b6af
7
+ data.tar.gz: 2c37132a2f9a37a0ca55cb540d28725b66b0ebbb4ff4dea5883bbb05079fe3681e073d3a3e8d130bdf8b7206c86b59f4a7fe803d8eeee171aa7e8f59f223a068
@@ -28,7 +28,7 @@ module CustomAttributes
28
28
  return unless context.class.name == 'Elasticsearch::Model::Indexing::Mappings'
29
29
 
30
30
  context.indexes :visible_in_search, type: 'boolean'
31
- context.indexes :custom_values, type: 'nested' do
31
+ context.indexes :custom_field_values, type: 'nested' do
32
32
  context.indexes :value, type: 'text', fields: { raw: { type: 'keyword' } }
33
33
  context.indexes :custom_field_id, type: 'integer'
34
34
  end
@@ -142,11 +142,11 @@ module CustomAttributes
142
142
  if type == :custom_fields
143
143
  next unless find_custom_field_by_slug(field_slug).sortable
144
144
  {
145
- 'custom_values.value.raw' => {
145
+ 'custom_field_values.value.raw' => {
146
146
  order: field_data || 'asc',
147
- nested_path: 'custom_values',
147
+ nested_path: 'custom_field_values',
148
148
  nested_filter: {
149
- term: { 'custom_values.custom_field_id' => resolve_custom_field_id(field_slug) }
149
+ term: { 'custom_field_values.custom_field_id' => resolve_custom_field_id(field_slug) }
150
150
  }
151
151
  }
152
152
  }
@@ -206,18 +206,18 @@ module CustomAttributes
206
206
  end
207
207
 
208
208
  def custom_query_scaffold(query, field_slug, filter = false)
209
- condition = { match: { 'custom_values.value' => query } }
210
- condition = { term: { 'custom_values.value.raw' => query } } if filter
209
+ condition = { match: { 'custom_field_values.value' => query } }
210
+ condition = { term: { 'custom_field_values.value.raw' => query } } if filter
211
211
 
212
212
  {
213
213
  nested: {
214
- path: 'custom_values',
214
+ path: 'custom_field_values',
215
215
  query: {
216
216
  bool: {
217
217
  must: [
218
218
  condition,
219
219
  {
220
- term: { 'custom_values.custom_field_id' => resolve_custom_field_id(field_slug) }
220
+ term: { 'custom_field_values.custom_field_id' => resolve_custom_field_id(field_slug) }
221
221
  }
222
222
  ]
223
223
  }
@@ -1,3 +1,3 @@
1
1
  module CustomAttributes
2
- VERSION = '0.5.11'.freeze
2
+ VERSION = '0.5.12'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: create_custom_attributes
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.11
4
+ version: 0.5.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Grützmacher