Commit e71a3cbeb3b57810a836bbd4776a3c9218273fb1

Authored by Andrew
1 parent 5bf01ede

Do not raise an error when id is indexed

Showing 2 changed files with 1 additions and 5 deletions   Show diff stats
CHANGELOG.md
... ... @@ -2,6 +2,7 @@
2 2  
3 3 - Fixed `Unsupported argument type: Symbol` for async partial reindex
4 4 - Fixed infinite recursion with multi search and misspellings below
  5 +- Do not raise an error when `id` is indexed
5 6  
6 7 ## 3.0.1
7 8  
... ...
lib/searchkick/record_data.rb
1 1 module Searchkick
2 2 class RecordData
3   - EXCLUDED_ATTRIBUTES = ["id", :id]
4 3 TYPE_KEYS = ["type", :type]
5 4  
6 5 attr_reader :index, :record
... ... @@ -50,11 +49,7 @@ module Searchkick
50 49 def search_data(method_name = nil)
51 50 partial_reindex = !method_name.nil?
52 51  
53   - # remove _id since search_id is used instead
54 52 source = record.send(method_name || :search_data)
55   - EXCLUDED_ATTRIBUTES.each do |attr|
56   - raise Searchkick::Error, "Cannot index a field with name: #{attr}" if source[attr]
57   - end
58 53  
59 54 # conversions
60 55 index.conversions_fields.each do |conversions_field|
... ...