Created
February 21, 2012 15:19
-
-
Save kalupa/1876994 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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