Skip to content

Commit 303f037

Browse files
committed
Updates are never updated!
1 parent bb03be6 commit 303f037

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

app/models/project.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Project < ApplicationRecord
2121
has_many :project_interests
2222
has_many :keywords, through: :project_interests
2323

24-
has_many :updates, dependent: :destroy
24+
has_many :updates, -> { order 'created_at DESC' }, dependent: :destroy
2525

2626
has_many :comments, as: :commentable, dependent: :destroy
2727

app/models/user.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class User < ApplicationRecord
77
validates_uniqueness_of :email
88

99
has_many :originated_projects, foreign_key: 'originator_id', class_name: 'Project'
10-
has_many :updates, -> { order 'updated_at DESC' }, foreign_key: 'author_id', dependent: :destroy
10+
has_many :updates, -> { order 'created_at DESC' }, foreign_key: 'author_id', dependent: :destroy
1111

1212
has_many :memberships
1313
has_many :comments, foreign_key: 'commenter_id'

0 commit comments

Comments
 (0)