Permette di correggere la timeline e ripristina la ricerca in alto.
CI / scan_ruby (push) Failing after 11m33s
CI / scan_js (push) Successful in 11m14s
CI / lint (push) Failing after 11m48s

Le voci si possono modificare o eliminare se registrate per errore, e la ricerca non va più in errore SQL sul campo email.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 23:09:30 +02:00
co-authored by Cursor
parent 4e03fa58ab
commit 34114e8ca8
8 changed files with 162 additions and 6 deletions
+29 -1
View File
@@ -1,5 +1,7 @@
class ActivitiesController < ApplicationController
before_action :set_organization, only: %i[create]
before_action :require_current_project!
before_action :set_organization
before_action :set_activity, only: %i[edit update destroy]
def create
@activity = @organization.activities.build(activity_params)
@@ -14,10 +16,36 @@ class ActivitiesController < ApplicationController
end
end
def edit
@page_title = "Modifica attività"
end
def update
if @activity.update(activity_params)
redirect_to @organization, notice: "Attività aggiornata."
else
@page_title = "Modifica attività"
render :edit, status: :unprocessable_entity
end
end
def destroy
@activity.destroy!
redirect_to @organization, notice: "Attività eliminata."
end
private
def set_organization
@organization = Organization.find(params[:organization_id])
return if current_user.admin?
return if @organization.projects.merge(available_projects).exists?
redirect_to organizations_path, alert: "Organizzazione non disponibile per i tuoi progetti." and return
end
def set_activity
@activity = @organization.activities.find(params[:id])
end
def activity_params