Skip to content

Commit e8aae88

Browse files
MONGOID-???? - Remove BSON::ObjectId#as_json as we will defer to the bson-ruby gem implementation. (#5057)
Co-authored-by: shields <[email protected]>
1 parent eaa6d26 commit e8aae88

File tree

2 files changed

+0
-20
lines changed

2 files changed

+0
-20
lines changed

lib/mongoid/extensions.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
# frozen_string_literal: true
22

3-
class BSON::ObjectId
4-
def as_json(options = nil)
5-
{ "$oid" => to_s }
6-
end
7-
end
8-
93
class BSON::Document
104
# We need to override this as ActiveSupport creates a new Object, instead of a new Hash
115
# see https://github.com/rails/rails/commit/f1bad130d0c9bd77c94e43b696adca56c46a66aa

spec/mongoid/extensions_spec.rb

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,6 @@
22

33
require "spec_helper"
44

5-
describe BSON::ObjectId do
6-
7-
describe "#as_json" do
8-
9-
let(:object_id) do
10-
described_class.new
11-
end
12-
13-
it "returns the $oid plus string" do
14-
expect(object_id.as_json).to eq("$oid" => object_id.to_s)
15-
end
16-
end
17-
end
18-
195
describe BSON::Document do
206

217
describe "#symbolize_keys" do

0 commit comments

Comments
 (0)