Skip to content

Commit

Permalink
Use #to_bson in ObjectId comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Oct 20, 2015
1 parent a45e2d4 commit b3dd8d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bson/object_id.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def as_json(*args)
#
# @since 2.0.0
def <=>(other)
generate_data <=> other.send(:generate_data)
generate_data <=> other.to_bson.to_s
end

# Return the UTC time at which this ObjectId was generated. This may
Expand Down

0 comments on commit b3dd8d5

Please sign in to comment.