Skip to content

Commit

Permalink
Fix NoMethodError for Bookmarks searchable.
Browse files Browse the repository at this point in the history
  • Loading branch information
mayaeh committed Mar 22, 2020
1 parent 56531d6 commit fda6aba
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/chewy/statuses_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ class StatusesIndex < Chewy::Index
data.each.with_object({}) { |(id, name), result| (result[id] ||= []).push(name) }
end

crutch :bookmarks do |collection|
data = ::Bookmark.where(status_id: collection.map(&:id)).where(account: Account.local).pluck(:status_id, :account_id)
data.each.with_object({}) { |(id, name), result| (result[id] ||= []).push(name) }
end

root date_detection: false do
field :id, type: 'long'
field :account_id, type: 'long'
Expand Down

0 comments on commit fda6aba

Please sign in to comment.