Sha256: 6eea0c85c4d926e5481c98868b663f758b9bedba07219e01bd356fde73eeff4f

Contents?: true

Size: 791 Bytes

Versions: 10

Compression:

Stored size: 791 Bytes

Contents

class Members::PeopleController < Members::MembersController
  def update
    address = Address.unhash(person_params.delete("address_attributes"))
    @person = current_member.person
    results = @person.update_attributes(person_params)
    @person.delay.new_note("Member made the following changes from their dashboard: #{@person.previous_changes_sentence}", Time.now, nil, current_member.organization.id)
    @person.address.update_with_note(@person, nil, address, current_member.organization.time_zone, "member dashboard")
    
    flash[:notice] = "Your changes have been saved."
    redirect_to members_root_path
  end

  private
    def person_params
      @person_params ||= params.fetch((:person),{}).merge(params.fetch(:company, {})).merge(params.fetch(:individual,{}))
    end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
artfully_ose-1.2.0 app/controllers/members/people_controller.rb
artfully_ose-1.2.0.beta.1 app/controllers/members/people_controller.rb
artfully_ose-1.2.0.alpha.2 app/controllers/members/people_controller.rb
artfully_ose-1.2.0.alpha.1 app/controllers/members/people_controller.rb
artfully_ose-1.2.0.pre.27 app/controllers/members/people_controller.rb
artfully_ose-1.2.0.pre.26 app/controllers/members/people_controller.rb
artfully_ose-1.2.0.pre.24 app/controllers/members/people_controller.rb
artfully_ose-1.2.0.pre.23 app/controllers/members/people_controller.rb
artfully_ose-1.2.0.pre.21 app/controllers/members/people_controller.rb
artfully_ose-1.2.0.pre.20 app/controllers/members/people_controller.rb