Commit 58905071203bf344d401c8b80812e5ee2d602f49

Authored by Andrew Kane
1 parent 86471441

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 550 end
551 551  
552 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 555 end
555 556  
556 557 def search_data(record)
... ...
test/test_helper.rb
... ... @@ -254,6 +254,10 @@ class Store
254 254 }
255 255 }
256 256  
  257 + def search_id
  258 + id
  259 + end
  260 +
257 261 def search_routing
258 262 name
259 263 end
... ...