Skip to content

Commit

Permalink
Merge pull request #12 from MeasureAuthoringTool/feature/mat-7190-qrd…
Browse files Browse the repository at this point in the history
…a-content-corrections

MAT-7190: Move mongoid ObjectId Override to service class
  • Loading branch information
jkotanchik-SB authored May 20, 2024
2 parents 551db39 + efcf5f5 commit 05421c0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
11 changes: 0 additions & 11 deletions model/mongoid.rb

This file was deleted.

12 changes: 12 additions & 0 deletions service/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,18 @@

puts "Loading QRDA Export Service"

# Override the as_json method to ensure the _id is displayed as
# just the _id value as a string in the QRDA XML, "<_id>".
# Without this override it will be serialized as extended
# BSON::JSON, "{$oid => "<_id>"}"
module BSON
class ObjectId
def as_json(*args)
to_s.as_json
end
end
end

Mongoid.load!("config/mongoid.yml")

use Rack::JSONBodyParser
Expand Down

0 comments on commit 05421c0

Please sign in to comment.