1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/app/controllers/settings/people_controller.rb

31 lines
663 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class Settings::PeopleController < ApplicationController
2019-09-02 09:47:06 -04:00
before_action :authenticate_user!, only: :new
before_action :set_account
before_action :set_person_from_token, only: :new
# GET /settings/person
def show
authorize %i[settings person]
end
# GET /settings/person/new
def new
authorize [:settings, @person]
MergeAccountPerson.call account: @account, person: @person
redirect_to %i[settings person]
end
private
def set_account
@account = current_account.clone&.reload
end
def set_person_from_token
@person = Person.find_by! account_connection_token: params[:token]
end
end