rails-api/active_model_serializers — pull request #306 by dgalarza (2013-05-21 14:21:10+00:00)
Title: Allow a controller to properly override scope_name

Currently the documentation states that you can override the default controller scope and scope name on a per action basis however the scope_name being passed in to override the default is not being used.

This pull request allows you to provide a scope_name and have it carry over into the serializers used.

Example usage taken from README.

```ruby
class CitiesController < ApplicationController
serialization_scope nil

def index
@cities = City.all

render :json => @cities, :each_serializer => CitySerializer
end

def show
@city = City.find(params[:id])

render :json => @city, :scope => current_admin, :scope_name => :current_admin
end
end
```