Class: V1::HouseholdsController

Inherits:
ApiController
  • Object
show all
Defined in:
api/app/api/v1/households_controller.rb

Overview

Manage Households

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.household_params(params) ⇒ Object

def update household = policy_scope(Household).find(params[:id]) authorize household, :update? Household.transaction do household.update_attributes!(self.class.household_params) if params[:subject_ids] && params[:subject_ids].any? household.subject_ids = policy_scope(Subject).where(id: params[:subject_ids]).pluck(:id) end end expose household, serializer: V1::HouseholdSerializer end

Instance Method Details

#household_for_subjectObject

Look up a household for a particular subject

Options

  • [Integer] subject_id

#searchObject

Search households. Unfortunately this one is still a POST because of constraints of a clientside library we used at the time of writing this end point.

#showObject

Show a household

Options

  • [Integer] id