Skip to content
This repository has been archived by the owner on Sep 27, 2022. It is now read-only.

Commit

Permalink
Fix find all for Rails 2.
Browse files Browse the repository at this point in the history
  • Loading branch information
savef committed Aug 28, 2015
1 parent 4ccbab8 commit b56a0e8
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/fuzzily/searchable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,12 @@ def _find_by_fuzzy(_o, pattern, options={})

def _load_for_ids(ids)
{}.tap do |result|
where(:id => ids).each { |_r| result[_r.id] = _r }
results = if respond_to? :where
where(:id => ids)
else
find(:all, ids)
end
results.each { |_r| result[_r.id] = _r }
end
end

Expand Down

0 comments on commit b56a0e8

Please sign in to comment.