home_controller unused param #31

Open
opened 2022-11-28 11:18:13 +01:00 by philipp · 0 comments
Owner

/app/controllers/home_controller.rb

  # cancel personal memberships direct from the myProfile-page
  def cancel_membership
    # TODO: membership_id not used anymore?
    if params[:membership_id]
      membership = @current_user.memberships.find(params[:membership_id])
    else
      membership = @current_user.memberships.find_by_group_id!(params[:group_id])
    end
    membership.destroy
    redirect_to my_profile_path, notice: I18n.t('home.ordergroup_cancelled', :group => membership.group.name)
  end

/app/controllers/home_controller.rb ```ruby # cancel personal memberships direct from the myProfile-page def cancel_membership # TODO: membership_id not used anymore? if params[:membership_id] membership = @current_user.memberships.find(params[:membership_id]) else membership = @current_user.memberships.find_by_group_id!(params[:group_id]) end membership.destroy redirect_to my_profile_path, notice: I18n.t('home.ordergroup_cancelled', :group => membership.group.name) end ```
philipp added the
refactoring
label 2022-11-28 11:18:13 +01:00
philipp added this to the Kanban project 2023-01-17 12:03:50 +01:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Foodsoft/foodsoft#31
No description provided.