rails-api/active_model_serializers — pull request #161 by kevins90 (2012-11-25 08:15:04+00:00)
Title: Fix serialization of attribute whose name matches the serializer prefix underscored

Removed unneeded method aliasing of the prefix of the serializer name to the attr_reader :object, I don't see any usage of it other than in test_fake.rb which I fixed to reference attr_reader :object itself.
The method alias is causing a problem with serialization of an accessor method whose name either mathces the prefix of the serializer of the underscored prefix of it.

Here's an example scenario:
class SomeSerializer < ActiveModel::Serializer
attributes :some
end

class SomeObject < Struct.new(:some)
end

Current behavior:
object = SomeObject.new("some value").as_json
=> {:some=>{:some=>#}}

Here is what is suppose to happen:
object = SomeObject.new("some value").as_json
=> {:some=>{:some=>"some value"}}