elasticsearch_record 1.3.0 → 1.3.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: 0e7302cf1310d0d583125bf9a9e526203feb42d000569b6daca266d88ae7bb50
4
- data.tar.gz: e67b0946f566b44232827244c323aa2e221796f4d0ac91adf4696179f4ba56e1
3
+ metadata.gz: e8e00649a9c1e9451d8ea006078889081a70cb178a3d0f23336d157929eefafc
4
+ data.tar.gz: '0596785a16b974b95a48ccb2bb3cb6a334ce553e8d80b1b82691ee98df18fe3b'
5
5
  SHA512:
6
- metadata.gz: 3fbf9f25937e5c77520af89de811c72bc9e2a51a49cbb1c6f7a77d0b2af8d2e533b3cc2fc11acf3f8b9a78ed5616c97c068cc88a1171e85bcc5611252960b345
7
- data.tar.gz: f8d77b26a20ddd8db5495638fdd98da72bcd1bd6978f17d6a1a794ab436fc184e3dafa153c67b364f6c89e59c5bca1eb0a59e09b240c4ea8e6055c017eb4738c
6
+ metadata.gz: 61301e89b67d34fd4ed604a782c85b84bd2316f98c7b67ddf293ad2a27e17e30531b905e7ecdc5a4d9dad34099d9feab8603269b2ee0e680b2a0cd2ff39835d3
7
+ data.tar.gz: d7d208605dbbe0c09acccacda2ac6deba8a69f85540046ac098b555b9bc5212e7c19c137df1957f0b692112dc694f2a3913538671183e18052061f417f1dbd4b
data/docs/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # ElasticsearchRecord - CHANGELOG
2
2
 
3
+ ## [1.3.1] - 2023-01-18
4
+ * [fix] `#none!` method to correctly invalidate the query (String(s) in where-queries like '1=0' will raise now)
5
+ * [fix] missing 'ChangeSettingDefinition' & 'RemoveSettingDefinition' @ `ActiveRecord::ConnectionAdapters::Elasticsearch::UpdateTableDefinition::COMPOSITE_DEFINITIONS` to composite in a single query
6
+ * [fix] `#unblock_table`-method in 'connection' to now remove blocks instead of setting to 'false'
7
+
3
8
  ## [1.3.0] - 2023-01-17
4
9
  * [add] 'metas: {}' param for `CreateTableDefinition` to provide individual meta information without providing them through 'mappings'
5
10
  * [add] 'change_'- & 'remove_'-methods for _mapping, setting & alias_ for `CreateTableDefinition`
@@ -14,6 +14,8 @@ module ActiveRecord
14
14
  ChangeMappingDefinition,
15
15
  ChangeMetaDefinition,
16
16
  AddSettingDefinition,
17
+ ChangeSettingDefinition,
18
+ RemoveSettingDefinition,
17
19
  RemoveAliasDefinition
18
20
  ].freeze
19
21
 
@@ -73,7 +73,7 @@ module ActiveRecord
73
73
  # @param [String] table_name
74
74
  # @return [Boolean] result state (returns false if refreshing failed)
75
75
  def refresh_table(table_name)
76
- api(:indices, :refresh, { index: table_name }, 'REFRESH TABLE').dig('_shards','failed') == 0
76
+ api(:indices, :refresh, { index: table_name }, 'REFRESH TABLE').dig('_shards', 'failed') == 0
77
77
  end
78
78
 
79
79
  # refresh indices by provided names.
@@ -138,13 +138,13 @@ module ActiveRecord
138
138
  def unblock_table(table_name, block_name = nil)
139
139
  if block_name.nil?
140
140
  change_table(table_name) do |t|
141
- t.change_setting('index.blocks.read', false)
142
- t.change_setting('index.blocks.write', false)
143
- t.change_setting('index.blocks.read_only', false)
144
- t.change_setting('index.blocks.metadata', false)
141
+ t.change_setting('index.blocks.read', nil)
142
+ t.change_setting('index.blocks.write', nil)
143
+ t.change_setting('index.blocks.read_only', nil)
144
+ t.change_setting('index.blocks.metadata', nil)
145
145
  end
146
146
  else
147
- change_setting(table_name, "index.blocks.#{block_name}", false)
147
+ change_setting(table_name, "index.blocks.#{block_name}", nil)
148
148
  end
149
149
  end
150
150
 
@@ -9,7 +9,7 @@ module ElasticsearchRecord
9
9
  module VERSION
10
10
  MAJOR = 1
11
11
  MINOR = 3
12
- TINY = 0
12
+ TINY = 1
13
13
  PRE = nil
14
14
 
15
15
  STRING = [MAJOR, MINOR, TINY, PRE].compact.join(".")
@@ -177,6 +177,11 @@ module ElasticsearchRecord
177
177
  self
178
178
  end
179
179
 
180
+ def none! # :nodoc:
181
+ # tell the query it 'failed'
182
+ configure!(:__query__, status: :failed).extending!(ActiveRecord::NullRelation)
183
+ end
184
+
180
185
  # creates a condition on the relation.
181
186
  # There are several possibilities to call this method.
182
187
  # @example
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch_record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Gonsior
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-17 00:00:00.000000000 Z
11
+ date: 2023-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord