app/controllers/phcmemberspro/member/addresses_controller.rb in phcmemberspro-20.5.0 vs app/controllers/phcmemberspro/member/addresses_controller.rb in phcmemberspro-20.5.1
- old
+ new
@@ -10,34 +10,34 @@
before_action :get_member_profile_info
before_action :set_member_address, only: [:show, :edit, :update, :destroy]
# INDEX - Directory Listings
def index
- profile = Member::Profile.friendly.find(params[:profile_id])
+ profile = Member::Profile.find(params[:profile_id])
@member_addresses = profile.addresses.where(oganization_id: authrocket_membership_info.org_id)
end
# LISTINGS DETAILS - Directory Listings
def show
- profile = Member::Profile.friendly.find(params[:profile_id])
- @member_address = profile.addresses.friendly.find(params[:id])
+ profile = Member::Profile.find(params[:profile_id])
+ @member_address = profile.addresses.find(params[:id])
@versions = PaperTrail::Version.where(item_id: params[:id], item_type: 'Phcmemberspro::Member::Address')
end
# NEW - Directory Listings
def new
- profile = Member::Profile.friendly.find(params[:profile_id])
+ profile = Member::Profile.find(params[:profile_id])
@member_address = profile.addresses.build
end
# EDIT - Directory Listings
def edit
end
# POST - Directory Listings
def create
- @profile = Member::Profile.friendly.find(params[:profile_id])
+ @profile = Member::Profile.find(params[:profile_id])
@member_address = @profile.addresses.create(member_address_params)
@member_address.user_id = current_user.id
@member_address.user_name = current_user.username
@member_address.membership_id = authrocket_membership_info.id
@member_address.oganization_id = authrocket_membership_info.org_id
@@ -61,20 +61,20 @@
end
end
# DELETE - Directory Listings
def destroy
- @profile = Member::Profile.friendly.find(params[:profile_id])
- @member_address = @profile.addresses.friendly.find(params[:id])
+ @profile = Member::Profile.find(params[:profile_id])
+ @member_address = @profile.addresses.find(params[:id])
@member_address.destroy
redirect_to member_profile_addresses_url, notice: 'Listing was successfully destroyed.'
end
private
# Common Callbacks
def set_member_address
- @member_address = Member::Address.friendly.find(params[:id])
+ @member_address = Member::Address.find(params[:id])
end
# Whitelist
def member_address_params
params.require(:member_address).permit(:id, :mcaddressl1, :mcaddressl2, :mccity, :mcprovince, :mccountry, :mcpostalcode, :mctype, :user_name, :profile_id, :slug, :user_id, :user_name, :membership_id, :oganization_id)