Touch parent folder of folder

This commit is contained in:
Urban Rotnik 2021-01-12 10:41:42 +01:00
parent e88848cd75
commit 996f604df1
2 changed files with 2 additions and 2 deletions

View file

@ -31,7 +31,7 @@ class Project < ApplicationRecord
class_name: 'User',
optional: true
belongs_to :team, inverse_of: :projects, touch: true
belongs_to :project_folder, inverse_of: :projects, optional: true
belongs_to :project_folder, inverse_of: :projects, optional: true, touch: true
has_many :user_projects, inverse_of: :project
has_many :users, through: :user_projects
has_many :experiments, inverse_of: :project

View file

@ -16,7 +16,7 @@ class ProjectFolder < ApplicationRecord
before_validation :ensure_uniqueness_name_on_moving, on: :update, if: -> { parent_folder_id_changed? }
belongs_to :team, inverse_of: :project_folders, touch: true
belongs_to :parent_folder, class_name: 'ProjectFolder', optional: true
belongs_to :parent_folder, class_name: 'ProjectFolder', optional: true, touch: true
belongs_to :archived_by, foreign_key: 'archived_by_id',
class_name: 'User',
inverse_of: :archived_project_folders,