Skip to content

Instantly share code, notes, and snippets.

@kalupa
Created February 21, 2012 15:19
Show Gist options
  • Save kalupa/1876994 to your computer and use it in GitHub Desktop.
Save kalupa/1876994 to your computer and use it in GitHub Desktop.
class Services::V1::UserEmploymentsController < ApplicationController
include Security::Services
include Services::ResourceValidations
def show
employment = find_employment(params)
render json: EmploymentSerializer.member(employment), status: :ok
end
private
def find_partner_account(id)
@partner.subscribers.find_by_id(id)
end
def find_employment(params)
account = find_partner_account(params[:account_id])
account.employments.where(user_id: params[:id]).first
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment