Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cs_comments_service
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
cs_comments_service
Commits
9fdd1959
Commit
9fdd1959
authored
Dec 19, 2013
by
Jim Abramson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #80 from edx/feature/jsa/yajl
use yajl for json serialization
parents
4b91b401
e8e778f4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletions
+22
-1
app.rb
+22
-0
spec/unicode_shared_examples.rb
+0
-1
No files found.
app.rb
View file @
9fdd1959
...
@@ -114,6 +114,28 @@ end
...
@@ -114,6 +114,28 @@ end
Mongoid
.
identity_map_enabled
=
true
Mongoid
.
identity_map_enabled
=
true
use
Rack
::
Mongoid
::
Middleware
::
IdentityMap
use
Rack
::
Mongoid
::
Middleware
::
IdentityMap
# use yajl implementation for to_json.
# https://github.com/brianmario/yajl-ruby#json-gem-compatibility-api
#
# In addition to performance advantages over the standard JSON gem,
# this avoids a bug with non-BMP characters. For more info see:
# https://github.com/rails/rails/issues/3727
require
'yajl/json_gem'
# patch json serialization of ObjectIds to work properly with yajl.
# See https://groups.google.com/forum/#!topic/mongoid/MaXFVw7D_4s
module
Moped
module
BSON
class
ObjectId
def
to_json
self
.
to_s
.
to_json
end
end
end
end
# these files must be required in order
# these files must be required in order
require
'./api/search'
require
'./api/search'
require
'./api/commentables'
require
'./api/commentables'
...
...
spec/unicode_shared_examples.rb
View file @
9fdd1959
...
@@ -14,7 +14,6 @@ shared_examples "unicode data" do
...
@@ -14,7 +14,6 @@ shared_examples "unicode data" do
end
end
it
"can handle non-BMP data"
do
it
"can handle non-BMP data"
do
pending
(
"circumventing a bug in ActiveSupport's JSON encoding of non-BMP characters"
)
test_unicode_data
(
"𝕋𝕙𝕚𝕤 𝕡𝕠𝕤𝕥 𝕔𝕠𝕟𝕥𝕒𝕚𝕟𝕤 𝕔𝕙𝕒𝕣𝕒𝕔𝕥𝕖𝕣𝕤 𝕠𝕦𝕥𝕤𝕚𝕕𝕖 𝕥𝕙𝕖 𝔹𝕄ℙ"
)
test_unicode_data
(
"𝕋𝕙𝕚𝕤 𝕡𝕠𝕤𝕥 𝕔𝕠𝕟𝕥𝕒𝕚𝕟𝕤 𝕔𝕙𝕒𝕣𝕒𝕔𝕥𝕖𝕣𝕤 𝕠𝕦𝕥𝕤𝕚𝕕𝕖 𝕥𝕙𝕖 𝔹𝕄ℙ"
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment