From 2367a98caf3a0fcf1e2bf7fff97321755277ddbd Mon Sep 17 00:00:00 2001 From: Dean Lofts Date: Thu, 8 Aug 2024 21:38:23 +1000 Subject: [PATCH] no need to create every time --- app/controllers/links_controller.rb | 4 ---- app/controllers/users/registrations_controller.rb | 2 -- 2 files changed, 6 deletions(-) diff --git a/app/controllers/links_controller.rb b/app/controllers/links_controller.rb index 3e8a8e8..863c8b1 100644 --- a/app/controllers/links_controller.rb +++ b/app/controllers/links_controller.rb @@ -1,4 +1,3 @@ -# app/controllers/links_controller.rb class LinksController < ApplicationController before_action :authenticate_user!, except: [:index, :show, :user_links] @@ -48,8 +47,6 @@ def user_links @pinned_links = @user.links.where(visible: true, pinned: true).order(:position) @achievements = @user.achievements.order(date: :desc) @user.tags = JSON.parse(@user.tags) if @user.tags.is_a?(String) - - OpenGraphImageGenerator.new(@user).generate end private @@ -57,5 +54,4 @@ def user_links def link_params params.require(:link).permit(:url, :title, :description, :position, :icon, :visible, :pinned) end - end diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index a21c799..7b195db 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -34,11 +34,9 @@ def update @user = current_user @user.tags = JSON.parse(@user.tags) if @user.tags.is_a?(String) - # If the user wants to update their password, require the current password if params[:user][:password].present? || params[:user][:password_confirmation].present? successfully_updated = @user.update_with_password(account_update_params) else - # Otherwise, allow updating without the current password params[:user].delete(:current_password) successfully_updated = @user.update_without_password(account_update_params.except(:current_password)) end