From 303f0371c7f64d18426384dd9dacc1277d615ed6 Mon Sep 17 00:00:00 2001 From: Henne Vogelsang Date: Sun, 9 Feb 2020 19:58:18 +0100 Subject: [PATCH] Updates are never updated! --- app/models/project.rb | 2 +- app/models/user.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/project.rb b/app/models/project.rb index 1f0e0cefa..4bc05a589 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -21,7 +21,7 @@ class Project < ApplicationRecord has_many :project_interests has_many :keywords, through: :project_interests - has_many :updates, dependent: :destroy + has_many :updates, -> { order 'created_at DESC' }, dependent: :destroy has_many :comments, as: :commentable, dependent: :destroy diff --git a/app/models/user.rb b/app/models/user.rb index e587f7c88..6fae10e34 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -7,7 +7,7 @@ class User < ApplicationRecord validates_uniqueness_of :email has_many :originated_projects, foreign_key: 'originator_id', class_name: 'Project' - has_many :updates, -> { order 'updated_at DESC' }, foreign_key: 'author_id', dependent: :destroy + has_many :updates, -> { order 'created_at DESC' }, foreign_key: 'author_id', dependent: :destroy has_many :memberships has_many :comments, foreign_key: 'commenter_id'