Skip to content

Commit

Permalink
Merge pull request #696 from yads/main
Browse files Browse the repository at this point in the history
fix mongoid8
  • Loading branch information
flyerhzm committed Nov 28, 2023
2 parents 5de1867 + ecadb96 commit e48c6c8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/bullet/mongoid8x.rb
Expand Up @@ -8,14 +8,14 @@ def self.enable
alias_method :origin_each, :each
alias_method :origin_eager_load, :eager_load

def first(opts = {})
result = origin_first(opts)
def first(limit = nil)
result = origin_first(limit)
Bullet::Detector::NPlusOneQuery.add_impossible_object(result) if result
result
end

def last(opts = {})
result = origin_last(opts)
def last(limit = nil)
result = origin_last(limit)
Bullet::Detector::NPlusOneQuery.add_impossible_object(result) if result
result
end
Expand Down

0 comments on commit e48c6c8

Please sign in to comment.