title: rails: active model serializer looking for wrong serializer
body: <p>When I call the the create method i get a nameError.</p>
  
  <pre><code>Failure/Error: post :create, { user: { email: 'charles@example.com',
       NameError:
         uninitialized constant API::V1::UsersController::UserV1Serializer
  </code></pre>
  
  <p>why is it adding that UsersController module to the class it is looking for? In my sessions controller I use the same exact render line and it doesn't complain. what is going on? </p>
  
  <h2>app/controllers/api/v1/users_controller.rb</h2>
  
  <pre><code>class API::V1::UsersController &lt; API::V1::BaseController
      ...
      ...
      def create
          user = User.new(user_params)
          if user.save
            sign_in :user, user, store: false
          end
          render json: user, serializer: UserV1Serializer, root: 'user'
        end
  </code></pre>
  
  <h2>app/serializers/api/v1/user_v1_serializer.rb</h2>
  
  <pre><code>class API::V1::UserV1Serializer &lt; ActiveModel::Serializer
    attributes :id, :email
  
    def attributes
      hash = super
      if scope == object
        hash[:token] = object.authentication_token
      end
      hash
    end
  end
  </code></pre>