class Api::V1::VersionsController < Api::BaseController
  respond_to :json, :xml, :yaml
  before_filter :find_rubygem

  def show
    if @rubygem.public_versions.count.nonzero?

      if stale?(@rubygem)
        respond_with(@rubygem.public_versions, :yamlish => true)
      end
    else
      render :text => "This rubygem could not be found.", :status => 404
    end
  end

  def reverse_dependencies
    respond_with(Version.reverse_dependencies(params[:id]), :yamlish => true)
  end
end

class Api::V1::VersionsController < Api::BaseController
  respond_to :json, :xml, :yaml
  before_filter :find_rubygem

  def show
    if @rubygem.public_versions.count.nonzero?

      if stale?(@rubygem)
        respond_with(@rubygem.public_versions, :yamlish => true)
      end
    else
      render :text => "This rubygem could not be found.", :status => 404
    end
  end

  def reverse_dependencies
    versions = Version.reverse_dependencies(params[:id])

    respond_to do |format|
      format.json { render :json => versions.map { |v| v.as_json.merge("full_name" => v.full_name) } }
      format.xml  { render :xml  => versions.map { |v| v.payload.merge("full_name" => v.full_name) } }
      format.yaml { render :text => versions.map { |v| v.payload.merge("full_name" => v.full_name) }.to_yaml }
    end
  end
end

Add full_name field to the reverse_dependencies payload
Add full_name field to the reverse_dependencies payload
