From fbdaf0e2a517660c0e4e3960f20b2d3568c33e78 Mon Sep 17 00:00:00 2001 From: Jeroen van Baarsen Date: Thu, 28 May 2015 11:06:30 +0200 Subject: Update noteable after a new note is added **What does this do?** It makes sure that whenever a new note is added to an noteable item, the updated_at of that item is also updated. **Why is this needed?** At this moment when you post a comment on an issue or add a label to an issue, the updated_at is not changed. Because of this the filtering for least recently updated is not really useful (since it only takes in account the original text from the noteable). Signed-off-by: Jeroen van Baarsen --- app/models/note.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app') diff --git a/app/models/note.rb b/app/models/note.rb index d5f716b3de0..6a74d62b715 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -31,7 +31,7 @@ class Note < ActiveRecord::Base participant :author, :mentioned_users belongs_to :project - belongs_to :noteable, polymorphic: true + belongs_to :noteable, polymorphic: true, touch: true belongs_to :author, class_name: "User" delegate :name, to: :project, prefix: true -- cgit v1.2.1