Skip to content

Instantly share code, notes, and snippets.

@biscuitvile
Created October 17, 2014 17:12
Show Gist options
  • Select an option

  • Save biscuitvile/7995a04af0772b9efb34 to your computer and use it in GitHub Desktop.

Select an option

Save biscuitvile/7995a04af0772b9efb34 to your computer and use it in GitHub Desktop.
module RepositionsAccountCollection
def update
if reposition.valid?
reposition.perform and render nothing: true, status: :ok
else
render json: reposition.errors.to_json, status: :unprocessable_entity
end
end
private
def reposition
@reposition ||= AccountReposition.new({
account: current_account,
collection_type: params[:collection_type],
positions: params[:positions]
})
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment