Repository navigation
Conversation
houndci-bot
reviewed
Oct 15, 2026
| context 'with an empty array stored in the database' do | ||
| let(:bar) do | ||
| document = Bar.create!(location: [1, 2]) | ||
| Bar.collection.find(_id: document.id).update_one('$set' => { location: [] }) |
Collaborator
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [82/80]
|
|
||
| require 'spec_helper' | ||
|
|
||
| describe Mongoid::Geospatial::Point, '.demongoize' do |
Collaborator
There was a problem hiding this comment.
Metrics/BlockLength: Block has too many lines. [31/25]
Collaborator
Author
There was a problem hiding this comment.
I think the bot is conflicting with rubocop rules - I propose leaving rubocop.
dblock
force-pushed
the
dblock/empty-point
branch
from
October 15, 2026 12:45
b687212 to
fc0ea36
Compare
houndci-bot
reviewed
Oct 15, 2026
| context 'with an empty array stored in the database' do | ||
| let(:person) do | ||
| document = Person.create!(location: [1, 2]) | ||
| Person.collection.find(_id: document.id).update_one('$set' => { location: [] }) |
Collaborator
There was a problem hiding this comment.
Metrics/LineLength: Line is too long. [85/80]
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dblock
force-pushed
the
dblock/empty-point
branch
from
October 18, 2026 14:57
fc0ea36 to
028b386
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #55.
Reading a Point stored as
[]currently callsPoint.newwithout coordinates and raisesArgumentError. Returnnilfor that empty stored value, matching existing empty-array assignment behavior. Reading does not rewrite the database, and malformed nonempty coordinates retain their existing error behavior.Add regression coverage for raw persisted empty arrays, replacing them with valid coordinates, explicitly clearing them, and preserving valid coordinates including zero and altitude. Update the README and changelog.
Validation
Focused Point specs and RuboCop pass.