Commit 12e9b50664c7ea59b0487ef827fbb180e33464f0
1 parent
7e14e594
Exists in
master
and in
18 other branches
Fixed support for NoBrainer and Cequel [skip ci]
Showing
3 changed files
with
7 additions
and
2 deletions
Show diff stats
lib/searchkick/model.rb
lib/searchkick/reindex_v2_job.rb
... | ... | @@ -13,7 +13,11 @@ module Searchkick |
13 | 13 | model = klass.constantize |
14 | 14 | record = |
15 | 15 | begin |
16 | - model.unscoped.find(id) | |
16 | + if model.respond_to?(:unscoped) | |
17 | + model.unscoped.find(id) | |
18 | + else | |
19 | + model.find(id) | |
20 | + end | |
17 | 21 | rescue => e |
18 | 22 | # check by name rather than rescue directly so we don't need |
19 | 23 | # to determine which classes are defined | ... | ... |
test/test_helper.rb
... | ... | @@ -134,7 +134,7 @@ elsif defined?(NoBrainer) |
134 | 134 | include NoBrainer::Document::Timestamps |
135 | 135 | |
136 | 136 | field :id, type: Object |
137 | - field :name, type: String | |
137 | + field :name, type: Text | |
138 | 138 | field :in_stock, type: Boolean |
139 | 139 | field :backordered, type: Boolean |
140 | 140 | field :orders_count, type: Integer | ... | ... |