Commit 58905071203bf344d401c8b80812e5ee2d602f49
1 parent
86471441
Exists in
master
and in
21 other branches
Added support for search_id method
Showing
2 changed files
with
6 additions
and
1 deletions
Show diff stats
lib/searchkick/index.rb
@@ -550,7 +550,8 @@ module Searchkick | @@ -550,7 +550,8 @@ module Searchkick | ||
550 | end | 550 | end |
551 | 551 | ||
552 | def search_id(record) | 552 | def search_id(record) |
553 | - record.id.is_a?(Numeric) ? record.id : record.id.to_s | 553 | + id = record.respond_to?(:search_id) ? record.search_id : record.id |
554 | + id.is_a?(Numeric) ? id : id.to_s | ||
554 | end | 555 | end |
555 | 556 | ||
556 | def search_data(record) | 557 | def search_data(record) |