Skip to content

Commit

Permalink
Merge pull request #23 from EverFi/FC-1357/fix-mongoid-not-defined
Browse files Browse the repository at this point in the history
FC-1357 Fix Mongoid not defined
  • Loading branch information
Steve Hodges authored Oct 12, 2022
2 parents 3b6427d + cc0223d commit 004a38f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
searchkick (5.0.4.pre.everfi.1.0.0)
searchkick (5.0.4.pre.everfi.1.0.1)
activemodel (>= 5.2)
hashie

Expand Down
4 changes: 3 additions & 1 deletion lib/searchkick.rb
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,10 @@ def self.refresh_value=(value)
def self.relation?(klass)
if klass.respond_to?(:current_scope)
!klass.current_scope.nil?
else
elsif defined?(Mongoid) # Should be fixed in upstream by https://github.com/ankane/searchkick/issues/1592
klass.is_a?(Mongoid::Criteria) || !Mongoid::Threaded.current_scope(klass).nil?
else
false
end
end

Expand Down
2 changes: 1 addition & 1 deletion lib/searchkick/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Searchkick
VERSION = "5.0.4.pre.everfi.1.0.0"
VERSION = "5.0.4.pre.everfi.1.0.1"
end

0 comments on commit 004a38f

Please sign in to comment.