elasticsearch-model 0.1.5 → 0.1.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- MjRiMDMxMDViNGQxODdmNTQ3Nzc4N2IyOWYyMTdiNzhlMmIzZWZhYw==
5
- data.tar.gz: !binary |-
6
- NjE4NjI4NDBkNDdjNTU4MjU1YTJhZDU0MzRmZTk1NDdkMTgxNDc1Mw==
2
+ SHA1:
3
+ metadata.gz: 6b66840bcd1e2b9f877f0c21c6e6c69c61bcc988
4
+ data.tar.gz: 7ddc2b0fc4089fa9079cdaf771d6f947950d90c4
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NWJhZjZjNzRiYmYwOTVlZjc4ZTk0ZTRhMWRkNWI0MWMxZTAxODVmYzAwZTM5
10
- NDc4MTkxMDZlOTRlMDc1MDkyMGUwZTNjZDU4MWE2Y2I5YmQ4MGI2NDA0NDVi
11
- NDI0MGUxNjdjOTE2MTQ4MmM2OTcwM2ZjMDA5Nzg3YTcwY2YzOTg=
12
- data.tar.gz: !binary |-
13
- NGM2NGM2NTBjNTEzMzdhNjZmYzI5MzM4NDZiYjEwOTQ4Y2Y2NWQyYTZiYWZl
14
- YWExZWQzZmI5NWRmOWRjNzExMDE3NGFjMTM2ODk4NDliOTNkOWI1M2UwZjRk
15
- MjA1MWFiODE1ZWY5ZGExZDMxZWZmNzIxNzNhNDAyMDlkZjdjZWI=
6
+ metadata.gz: bf83de14e369c4acb429559fd1e6f4522e45b0b275fcf594df185a96593ae9d4791ff3f7214d6a19f7a8e10ee073da897424c0d44571f5369cca2b39abf4b131
7
+ data.tar.gz: 345b76b6c9b3bacc5eab1538040188d7a622a9469dbfc89e4495392448d8a5c77dbf0cca0e0af678c916ebceb0fc2347eaf08d5aec26da7fe5bc8ffff26ebcf3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## 0.1.6
2
+
3
+ * Improved documentation
4
+ * Added dynamic getter/setter (block/proc) for `MyModel.index_name`
5
+ * Added the `update_document_attributes` method
6
+ * Added, that records to import can be limited by the `query` option
7
+
1
8
  ## 0.1.5
2
9
 
3
10
  * Improved documentation
data/README.md CHANGED
@@ -146,7 +146,7 @@ Article.import
146
146
  # => 0
147
147
  ```
148
148
 
149
- It's possible to import only records from a specific `scope`, transform the batch with the `transform`
149
+ It's possible to import only records from a specific `scope` or `query`, transform the batch with the `transform`
150
150
  and `preprocess` options, or re-create the index by deleting it and creating it with correct mapping with the `force` option -- look for examples in the method documentation.
151
151
 
152
152
  No errors were reported during importing, so... let's search the index!
@@ -422,7 +422,7 @@ class Article
422
422
  end
423
423
  ```
424
424
 
425
- For ActiveRecord-based models, you need to hook into the `after_commit` callback, to protect
425
+ For ActiveRecord-based models, use the `after_commit` callback to protect
426
426
  your data against inconsistencies caused by transaction rollbacks:
427
427
 
428
428
  ```ruby
data/Rakefile CHANGED
@@ -34,10 +34,12 @@ namespace :test do
34
34
  sh "BUNDLE_GEMFILE='#{File.expand_path('../gemfiles/4.0.gemfile', __FILE__)}' bundle exec rake test:run_integration"
35
35
  end
36
36
 
37
- Rake::TestTask.new(:all) do |test|
37
+ desc "Run unit and integration tests"
38
+ task :all do
38
39
  Rake::Task['test:ci_reporter'].invoke if ENV['CI']
39
- test.libs << 'lib' << 'test'
40
- test.test_files = FileList["test/unit/**/*_test.rb", "test/integration/**/*_test.rb"]
40
+
41
+ Rake::Task['test:unit'].invoke
42
+ Rake::Task['test:integration'].invoke
41
43
  end
42
44
  end
43
45
 
@@ -39,7 +39,7 @@ Gem::Specification.new do |s|
39
39
  s.add_development_dependency "kaminari"
40
40
  s.add_development_dependency "will_paginate"
41
41
 
42
- s.add_development_dependency "minitest", "~> 4"
42
+ s.add_development_dependency "minitest", "~> 4.2"
43
43
  s.add_development_dependency "test-unit" if defined?(RUBY_VERSION) && RUBY_VERSION > '2.2'
44
44
  s.add_development_dependency "shoulda-context"
45
45
  s.add_development_dependency "mocha"
@@ -84,10 +84,13 @@ module Elasticsearch
84
84
  # @see http://api.rubyonrails.org/classes/ActiveRecord/Batches.html ActiveRecord::Batches.find_in_batches
85
85
  #
86
86
  def __find_in_batches(options={}, &block)
87
+ query = options.delete(:query)
87
88
  named_scope = options.delete(:scope)
88
89
  preprocess = options.delete(:preprocess)
89
90
 
90
- scope = named_scope ? self.__send__(named_scope) : self
91
+ scope = self
92
+ scope = scope.__send__(named_scope) if named_scope
93
+ scope = scope.instance_exec(&query) if query
91
94
 
92
95
  scope.find_in_batches(options) do |batch|
93
96
  yield (preprocess ? self.__send__(preprocess, batch) : batch)
@@ -68,6 +68,10 @@ module Elasticsearch
68
68
  #
69
69
  # Article.import scope: 'published'
70
70
  #
71
+ # @example Pass an ActiveRecord query to limit the imported records
72
+ #
73
+ # Article.import query: -> { where(author_id: author_id) }
74
+ #
71
75
  # @example Transform records during the import with a lambda
72
76
  #
73
77
  # transform = lambda do |a|
@@ -317,6 +317,8 @@ module Elasticsearch
317
317
  #
318
318
  # When the changed attributes are not available, performs full re-index of the record.
319
319
  #
320
+ # See the {#update_document_attributes} method for updating specific attributes directly.
321
+ #
320
322
  # @param options [Hash] Optional arguments for passing to the client
321
323
  #
322
324
  # @example Update a document corresponding to the record
@@ -351,6 +353,29 @@ module Elasticsearch
351
353
  index_document(options)
352
354
  end
353
355
  end
356
+
357
+ # Perform a _partial_ update of specific document attributes
358
+ # (without consideration for changed attributes as in {#update_document})
359
+ #
360
+ # @param attributes [Hash] Attributes to be updated
361
+ # @param options [Hash] Optional arguments for passing to the client
362
+ #
363
+ # @example Update the `title` attribute
364
+ #
365
+ # @article = Article.first
366
+ # @article.title = "New title"
367
+ # @article.__elasticsearch__.update_document_attributes title: "New title"
368
+ #
369
+ # @return [Hash] The response from Elasticsearch
370
+ #
371
+ def update_document_attributes(attributes, options={})
372
+ client.update(
373
+ { index: index_name,
374
+ type: document_type,
375
+ id: self.id,
376
+ body: { doc: attributes } }.merge(options)
377
+ )
378
+ end
354
379
  end
355
380
 
356
381
  end
@@ -15,14 +15,27 @@ module Elasticsearch
15
15
  # index_name "articles-#{Rails.env}"
16
16
  # end
17
17
  #
18
+ # @example Set the index name for the `Article` model and re-evaluate it on each call
19
+ #
20
+ # class Article
21
+ # index_name { "articles-#{Time.now.year}" }
22
+ # end
23
+ #
18
24
  # @example Directly set the index name for the `Article` model
19
25
  #
20
26
  # Article.index_name "articles-#{Rails.env}"
21
27
  #
22
- # TODO: Dynamic names a la Tire -- `Article.index_name { "articles-#{Time.now.year}" }`
23
28
  #
24
- def index_name name=nil
25
- @index_name = name || @index_name || self.model_name.collection.gsub(/\//, '-')
29
+ def index_name name=nil, &block
30
+ if name || block_given?
31
+ return (@index_name = name || block)
32
+ end
33
+
34
+ if @index_name.respond_to?(:call)
35
+ @index_name.call
36
+ else
37
+ @index_name || self.model_name.collection.gsub(/\//, '-')
38
+ end
26
39
  end
27
40
 
28
41
  # Set the index name
@@ -67,8 +80,16 @@ module Elasticsearch
67
80
  # @article.index_name "articles-#{@article.user_id}"
68
81
  # @article.__elasticsearch__.update_document
69
82
  #
70
- def index_name name=nil
71
- @index_name = name || @index_name || self.class.index_name
83
+ def index_name name=nil, &block
84
+ if name || block_given?
85
+ return (@index_name = name || block)
86
+ end
87
+
88
+ if @index_name.respond_to?(:call)
89
+ @index_name.call
90
+ else
91
+ @index_name || self.class.index_name
92
+ end
72
93
  end
73
94
 
74
95
  # Set the index name
@@ -8,7 +8,7 @@ module Elasticsearch
8
8
  # Wraps a search request definition
9
9
  #
10
10
  class SearchRequest
11
- attr_reader :klass, :definition
11
+ attr_reader :klass, :definition, :options
12
12
 
13
13
  # @param klass [Class] The class of the model
14
14
  # @param query_or_payload [String,Hash,Object] The search request definition
@@ -17,6 +17,7 @@ module Elasticsearch
17
17
  #
18
18
  def initialize(klass, query_or_payload, options={})
19
19
  @klass = klass
20
+ @options = options
20
21
 
21
22
  __index_name = options[:index] || klass.index_name
22
23
  __document_type = options[:type] || klass.document_type
@@ -1,5 +1,5 @@
1
1
  module Elasticsearch
2
2
  module Model
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
  end
5
5
  end
@@ -128,6 +128,24 @@ module Elasticsearch
128
128
  assert_equal 1, response.records.size
129
129
  end
130
130
 
131
+ should "update specific attributes" do
132
+ article = Article.first
133
+
134
+ response = Article.search 'title:special'
135
+
136
+ assert_equal 0, response.results.size
137
+ assert_equal 0, response.records.size
138
+
139
+ article.__elasticsearch__.update_document_attributes title: 'special'
140
+
141
+ Article.__elasticsearch__.refresh_index!
142
+
143
+ response = Article.search 'title:special'
144
+
145
+ assert_equal 1, response.results.size
146
+ assert_equal 1, response.records.size
147
+ end
148
+
131
149
  should "return results for a DSL search" do
132
150
  response = Article.search query: { match: { title: { query: 'test' } } }
133
151
 
@@ -62,6 +62,15 @@ module Elasticsearch
62
62
  assert_equal 50, ImportArticle.search('*').results.total
63
63
  end
64
64
 
65
+ should "import only documents from a specific query" do
66
+ assert_equal 100, ImportArticle.count
67
+
68
+ assert_equal 0, ImportArticle.import(query: -> { where('views >= 30') })
69
+
70
+ ImportArticle.__elasticsearch__.refresh_index!
71
+ assert_equal 70, ImportArticle.search('*').results.total
72
+ end
73
+
65
74
  should "report and not store/index invalid documents" do
66
75
  ImportArticle.create! title: "Test INVALID", numeric: "INVALID"
67
76
 
@@ -102,6 +102,19 @@ module Elasticsearch
102
102
  assert_equal 12, records.size
103
103
  end
104
104
 
105
+ should "respect sort" do
106
+ search = ArticleForPagination.search({ query: { match: { title: 'test' } }, sort: [ { id: 'desc' } ] })
107
+
108
+ records = search.page(2).records
109
+ assert_equal 43, records.first.id # 68 - 25 = 42
110
+
111
+ records = search.page(3).records
112
+ assert_equal 18, records.first.id # 68 - (2 * 25) = 18
113
+
114
+ records = search.page(2).per(5).records
115
+ assert_equal 63, records.first.id # 68 - 5 = 63
116
+ end
117
+
105
118
  should "set the limit per request" do
106
119
  records = ArticleForPagination.search('title:test').limit(50).page(2).records
107
120
 
@@ -0,0 +1,47 @@
1
+ require 'test_helper'
2
+ require 'active_record'
3
+
4
+ module Elasticsearch
5
+ module Model
6
+ class DynamicIndexNameTest < Elasticsearch::Test::IntegrationTestCase
7
+ context "Dynamic index name" do
8
+ setup do
9
+ class ::ArticleWithDynamicIndexName < ActiveRecord::Base
10
+ include Elasticsearch::Model
11
+ include Elasticsearch::Model::Callbacks
12
+
13
+ def self.counter=(value)
14
+ @counter = 0
15
+ end
16
+
17
+ def self.counter
18
+ (@counter ||= 0) && @counter += 1
19
+ end
20
+
21
+ mapping { indexes :title }
22
+ index_name { "articles-#{counter}" }
23
+ end
24
+
25
+ ::ActiveRecord::Schema.define(:version => 1) do
26
+ create_table ::ArticleWithDynamicIndexName.table_name do |t|
27
+ t.string :title
28
+ end
29
+ end
30
+
31
+ ::ArticleWithDynamicIndexName.counter = 0
32
+ end
33
+
34
+ should 'evaluate the index_name value' do
35
+ assert_equal ArticleWithDynamicIndexName.index_name, "articles-1"
36
+ end
37
+
38
+ should 're-evaluate the index_name value each time' do
39
+ assert_equal ArticleWithDynamicIndexName.index_name, "articles-1"
40
+ assert_equal ArticleWithDynamicIndexName.index_name, "articles-2"
41
+ assert_equal ArticleWithDynamicIndexName.index_name, "articles-3"
42
+ end
43
+ end
44
+
45
+ end
46
+ end
47
+ end
@@ -104,6 +104,13 @@ class Elasticsearch::Model::AdapterActiveRecordTest < Test::Unit::TestCase
104
104
  DummyClassForActiveRecord.__find_in_batches(scope: :published) do; end
105
105
  end
106
106
 
107
+ should "limit the relation to a specific query" do
108
+ DummyClassForActiveRecord.expects(:find_in_batches).returns([])
109
+ DummyClassForActiveRecord.expects(:where).returns(DummyClassForActiveRecord)
110
+
111
+ DummyClassForActiveRecord.__find_in_batches(query: -> { where(color: "red") }) do; end
112
+ end
113
+
107
114
  should "preprocess the batch if option provided" do
108
115
  class << DummyClassForActiveRecord
109
116
  # Updates/transforms the batch while fetching it from the database
@@ -323,6 +323,48 @@ class Elasticsearch::Model::IndexingTest < Test::Unit::TestCase
323
323
 
324
324
  instance.update_document
325
325
  end
326
+
327
+ should "update only the specific attributes" do
328
+ client = mock('client')
329
+ instance = ::DummyIndexingModelWithCallbacks.new
330
+
331
+ # Set the fake `changes` hash
332
+ instance.instance_variable_set(:@__changed_attributes, {author: 'john'})
333
+
334
+ client.expects(:update).with do |payload|
335
+ assert_equal 'foo', payload[:index]
336
+ assert_equal 'bar', payload[:type]
337
+ assert_equal '1', payload[:id]
338
+ assert_equal({title: 'green'}, payload[:body][:doc])
339
+ end
340
+
341
+ instance.expects(:client).returns(client)
342
+ instance.expects(:index_name).returns('foo')
343
+ instance.expects(:document_type).returns('bar')
344
+ instance.expects(:id).returns('1')
345
+
346
+ instance.update_document_attributes title: "green"
347
+ end
348
+
349
+ should "pass options to the update_document_attributes method" do
350
+ client = mock('client')
351
+ instance = ::DummyIndexingModelWithCallbacks.new
352
+
353
+ client.expects(:update).with do |payload|
354
+ assert_equal 'foo', payload[:index]
355
+ assert_equal 'bar', payload[:type]
356
+ assert_equal '1', payload[:id]
357
+ assert_equal({title: 'green'}, payload[:body][:doc])
358
+ assert_equal true, payload[:refresh]
359
+ end
360
+
361
+ instance.expects(:client).returns(client)
362
+ instance.expects(:index_name).returns('foo')
363
+ instance.expects(:document_type).returns('bar')
364
+ instance.expects(:id).returns('1')
365
+
366
+ instance.update_document_attributes( { title: "green" }, { refresh: true } )
367
+ end
326
368
  end
327
369
 
328
370
  context "Re-creating the index" do
@@ -40,6 +40,20 @@ class Elasticsearch::Model::NamingTest < Test::Unit::TestCase
40
40
  d = DummyNamingModel.new
41
41
  d.index_name 'foobar_d'
42
42
  assert_equal 'foobar_d', d.index_name
43
+
44
+ modifier = 'r'
45
+ d.index_name Proc.new{ "foobar_#{modifier}" }
46
+ assert_equal 'foobar_r', d.index_name
47
+
48
+ modifier = 'z'
49
+ assert_equal 'foobar_z', d.index_name
50
+
51
+ modifier = 'f'
52
+ d.index_name { "foobar_#{modifier}" }
53
+ assert_equal 'foobar_f', d.index_name
54
+
55
+ modifier = 't'
56
+ assert_equal 'foobar_t', d.index_name
43
57
  end
44
58
 
45
59
  should "set the index_name with setter" do
@@ -51,6 +65,19 @@ class Elasticsearch::Model::NamingTest < Test::Unit::TestCase
51
65
  assert_equal 'foobar_index_s', d.index_name
52
66
 
53
67
  assert_equal 'foobar_index_S', DummyNamingModel.index_name
68
+
69
+ modifier2 = 'y'
70
+ DummyNamingModel.index_name = Proc.new{ "foobar_index_#{modifier2}" }
71
+ assert_equal 'foobar_index_y', DummyNamingModel.index_name
72
+
73
+ modifier = 'r'
74
+ d.index_name = Proc.new{ "foobar_index_#{modifier}" }
75
+ assert_equal 'foobar_index_r', d.index_name
76
+
77
+ modifier = 'z'
78
+ assert_equal 'foobar_index_z', d.index_name
79
+
80
+ assert_equal 'foobar_index_y', DummyNamingModel.index_name
54
81
  end
55
82
 
56
83
  should "set and return the document_type" do
metadata CHANGED
@@ -1,321 +1,321 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elasticsearch-model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karel Minarik
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-04 00:00:00.000000000 Z
11
+ date: 2014-10-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: elasticsearch
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ! '>'
17
+ - - ">"
18
18
  - !ruby/object:Gem::Version
19
19
  version: '0.4'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ! '>'
24
+ - - ">"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '0.4'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>'
31
+ - - ">"
32
32
  - !ruby/object:Gem::Version
33
33
  version: '3'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ! '>'
38
+ - - ">"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: hashie
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ! '>='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
47
  version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ! '>='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
54
  version: '0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
- - - ~>
59
+ - - "~>"
60
60
  - !ruby/object:Gem::Version
61
61
  version: '1.3'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
- - - ~>
66
+ - - "~>"
67
67
  - !ruby/object:Gem::Version
68
68
  version: '1.3'
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: rake
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ! '>='
73
+ - - ">="
74
74
  - !ruby/object:Gem::Version
75
75
  version: '0'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ! '>='
80
+ - - ">="
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: elasticsearch-extensions
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
- - - ! '>='
87
+ - - ">="
88
88
  - !ruby/object:Gem::Version
89
89
  version: '0'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
- - - ! '>='
94
+ - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: sqlite3
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - ! '>='
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - ! '>='
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: activemodel
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - ! '>'
115
+ - - ">"
116
116
  - !ruby/object:Gem::Version
117
117
  version: '3.0'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - ! '>'
122
+ - - ">"
123
123
  - !ruby/object:Gem::Version
124
124
  version: '3.0'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: oj
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
- - - ! '>='
129
+ - - ">="
130
130
  - !ruby/object:Gem::Version
131
131
  version: '0'
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
- - - ! '>='
136
+ - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: kaminari
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
- - - ! '>='
143
+ - - ">="
144
144
  - !ruby/object:Gem::Version
145
145
  version: '0'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
- - - ! '>='
150
+ - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
154
  name: will_paginate
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
- - - ! '>='
157
+ - - ">="
158
158
  - !ruby/object:Gem::Version
159
159
  version: '0'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
- - - ! '>='
164
+ - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: minitest
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ~>
171
+ - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '4'
173
+ version: '4.2'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ~>
178
+ - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '4'
180
+ version: '4.2'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: shoulda-context
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
- - - ! '>='
185
+ - - ">="
186
186
  - !ruby/object:Gem::Version
187
187
  version: '0'
188
188
  type: :development
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
- - - ! '>='
192
+ - - ">="
193
193
  - !ruby/object:Gem::Version
194
194
  version: '0'
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: mocha
197
197
  requirement: !ruby/object:Gem::Requirement
198
198
  requirements:
199
- - - ! '>='
199
+ - - ">="
200
200
  - !ruby/object:Gem::Version
201
201
  version: '0'
202
202
  type: :development
203
203
  prerelease: false
204
204
  version_requirements: !ruby/object:Gem::Requirement
205
205
  requirements:
206
- - - ! '>='
206
+ - - ">="
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0'
209
209
  - !ruby/object:Gem::Dependency
210
210
  name: turn
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - ! '>='
213
+ - - ">="
214
214
  - !ruby/object:Gem::Version
215
215
  version: '0'
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ! '>='
220
+ - - ">="
221
221
  - !ruby/object:Gem::Version
222
222
  version: '0'
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: yard
225
225
  requirement: !ruby/object:Gem::Requirement
226
226
  requirements:
227
- - - ! '>='
227
+ - - ">="
228
228
  - !ruby/object:Gem::Version
229
229
  version: '0'
230
230
  type: :development
231
231
  prerelease: false
232
232
  version_requirements: !ruby/object:Gem::Requirement
233
233
  requirements:
234
- - - ! '>='
234
+ - - ">="
235
235
  - !ruby/object:Gem::Version
236
236
  version: '0'
237
237
  - !ruby/object:Gem::Dependency
238
238
  name: ruby-prof
239
239
  requirement: !ruby/object:Gem::Requirement
240
240
  requirements:
241
- - - ! '>='
241
+ - - ">="
242
242
  - !ruby/object:Gem::Version
243
243
  version: '0'
244
244
  type: :development
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
- - - ! '>='
248
+ - - ">="
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: pry
253
253
  requirement: !ruby/object:Gem::Requirement
254
254
  requirements:
255
- - - ! '>='
255
+ - - ">="
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  type: :development
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
- - - ! '>='
262
+ - - ">="
263
263
  - !ruby/object:Gem::Version
264
264
  version: '0'
265
265
  - !ruby/object:Gem::Dependency
266
266
  name: ci_reporter
267
267
  requirement: !ruby/object:Gem::Requirement
268
268
  requirements:
269
- - - ~>
269
+ - - "~>"
270
270
  - !ruby/object:Gem::Version
271
271
  version: '1.9'
272
272
  type: :development
273
273
  prerelease: false
274
274
  version_requirements: !ruby/object:Gem::Requirement
275
275
  requirements:
276
- - - ~>
276
+ - - "~>"
277
277
  - !ruby/object:Gem::Version
278
278
  version: '1.9'
279
279
  - !ruby/object:Gem::Dependency
280
280
  name: simplecov
281
281
  requirement: !ruby/object:Gem::Requirement
282
282
  requirements:
283
- - - ! '>='
283
+ - - ">="
284
284
  - !ruby/object:Gem::Version
285
285
  version: '0'
286
286
  type: :development
287
287
  prerelease: false
288
288
  version_requirements: !ruby/object:Gem::Requirement
289
289
  requirements:
290
- - - ! '>='
290
+ - - ">="
291
291
  - !ruby/object:Gem::Version
292
292
  version: '0'
293
293
  - !ruby/object:Gem::Dependency
294
294
  name: cane
295
295
  requirement: !ruby/object:Gem::Requirement
296
296
  requirements:
297
- - - ! '>='
297
+ - - ">="
298
298
  - !ruby/object:Gem::Version
299
299
  version: '0'
300
300
  type: :development
301
301
  prerelease: false
302
302
  version_requirements: !ruby/object:Gem::Requirement
303
303
  requirements:
304
- - - ! '>='
304
+ - - ">="
305
305
  - !ruby/object:Gem::Version
306
306
  version: '0'
307
307
  - !ruby/object:Gem::Dependency
308
308
  name: require-prof
309
309
  requirement: !ruby/object:Gem::Requirement
310
310
  requirements:
311
- - - ! '>='
311
+ - - ">="
312
312
  - !ruby/object:Gem::Version
313
313
  version: '0'
314
314
  type: :development
315
315
  prerelease: false
316
316
  version_requirements: !ruby/object:Gem::Requirement
317
317
  requirements:
318
- - - ! '>='
318
+ - - ">="
319
319
  - !ruby/object:Gem::Version
320
320
  version: '0'
321
321
  description: ActiveModel/Record integrations for Elasticsearch.
@@ -327,7 +327,7 @@ extra_rdoc_files:
327
327
  - README.md
328
328
  - LICENSE.txt
329
329
  files:
330
- - .gitignore
330
+ - ".gitignore"
331
331
  - CHANGELOG.md
332
332
  - Gemfile
333
333
  - LICENSE.txt
@@ -371,6 +371,7 @@ files:
371
371
  - test/integration/active_record_import_test.rb
372
372
  - test/integration/active_record_namespaced_model_test.rb
373
373
  - test/integration/active_record_pagination_test.rb
374
+ - test/integration/dynamic_index_name_test.rb
374
375
  - test/integration/mongoid_basic_test.rb
375
376
  - test/test_helper.rb
376
377
  - test/unit/adapter_active_record_test.rb
@@ -400,17 +401,17 @@ licenses:
400
401
  metadata: {}
401
402
  post_install_message:
402
403
  rdoc_options:
403
- - --charset=UTF-8
404
+ - "--charset=UTF-8"
404
405
  require_paths:
405
406
  - lib
406
407
  required_ruby_version: !ruby/object:Gem::Requirement
407
408
  requirements:
408
- - - ! '>='
409
+ - - ">="
409
410
  - !ruby/object:Gem::Version
410
411
  version: 1.9.3
411
412
  required_rubygems_version: !ruby/object:Gem::Requirement
412
413
  requirements:
413
- - - ! '>='
414
+ - - ">="
414
415
  - !ruby/object:Gem::Version
415
416
  version: '0'
416
417
  requirements: []
@@ -427,6 +428,7 @@ test_files:
427
428
  - test/integration/active_record_import_test.rb
428
429
  - test/integration/active_record_namespaced_model_test.rb
429
430
  - test/integration/active_record_pagination_test.rb
431
+ - test/integration/dynamic_index_name_test.rb
430
432
  - test/integration/mongoid_basic_test.rb
431
433
  - test/test_helper.rb
432
434
  - test/unit/adapter_active_record_test.rb