Skip to content

Commit

Permalink
Test if lib/mongoid/atomic.rb broke specs
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnyshields committed Apr 20, 2024
1 parent 5a0eef9 commit 51ef478
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/mongoid/atomic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,15 @@ def atomic_position
#
# @return [ Object ] The associated path.
def atomic_paths
@atomic_paths ||= if _association
_association.path(self)
else
Atomic::Paths::Root.new(self)
end
return @atomic_paths if @atomic_paths

paths = if _association
_association.path(self)
else
Atomic::Paths::Root.new(self)
end

paths.tap { @atomic_paths = paths unless new_record? }
end

# Get all the attributes that need to be pulled.
Expand Down

0 comments on commit 51ef478

Please sign in to comment.