Skip to content

Commit

Permalink
Updates are never updated!
Browse files Browse the repository at this point in the history
  • Loading branch information
hennevogel committed Feb 9, 2020
1 parent bb03be6 commit 303f037
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/models/project.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 303f037

Please sign in to comment.