Commit e71a3cbeb3b57810a836bbd4776a3c9218273fb1
1 parent
5bf01ede
Exists in
master
and in
18 other branches
Do not raise an error when id is indexed
Showing
2 changed files
with
1 additions
and
5 deletions
Show diff stats
CHANGELOG.md
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| | ... | ... |