Created
October 17, 2014 17:12
-
-
Save biscuitvile/7995a04af0772b9efb34 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| 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