reverting PR #909 and adding json api usage advise on readme

This commit is contained in:
João Moura
2015-05-27 18:33:12 -03:00
parent 12adb2e6d4
commit a40df8fd3d
4 changed files with 8 additions and 10 deletions

View File

@@ -4,7 +4,7 @@ module ActionController
module Serialization
class AdapterSelectorTest < ActionController::TestCase
class MyController < ActionController::Base
def render_using_the_initializer_defined_adapter
def render_using_default_adapter
@profile = Profile.new({ name: 'Name 1', description: 'Description 1', comments: 'Comments 1' })
render json: @profile
end
@@ -23,7 +23,7 @@ module ActionController
tests MyController
def test_render_using_default_adapter
get :render_using_the_initializer_defined_adapter
get :render_using_default_adapter
assert_equal '{"name":"Name 1","description":"Description 1"}', response.body
end

View File

@@ -1,5 +1,3 @@
ActiveModel::Serializer.config.adapter = :json
class Model
def initialize(hash={})
@attributes = hash
@@ -66,7 +64,7 @@ Author = Class.new(Model)
Bio = Class.new(Model)
Blog = Class.new(Model)
Role = Class.new(Model)
User = Class.new(Model)
User = Class.new(Model)
Location = Class.new(Model)
Place = Class.new(Model)