diff --git a/app/models/repertoire.rb b/app/models/repertoire.rb index 995d52d0b..5c37eb3b6 100644 --- a/app/models/repertoire.rb +++ b/app/models/repertoire.rb @@ -1,6 +1,6 @@ class Repertoire < ApplicationRecord default_scope :order => 'updated_at desc' - has_many :sub_repertoires, ->{order("sub_repertoires.updated_at desc")}, :dependent => :destroy + has_many :sub_repertoires, ->{order(updated_at: :desc)}, :dependent => :destroy has_many :tag_repertoires, through: :sub_repertoires end diff --git a/app/models/sub_repertoire.rb b/app/models/sub_repertoire.rb index 9f7079cfc..d6a6c1b3d 100644 --- a/app/models/sub_repertoire.rb +++ b/app/models/sub_repertoire.rb @@ -1,5 +1,5 @@ class SubRepertoire < ApplicationRecord belongs_to :repertoire - has_many :tag_repertoires, ->{order("tag_repertoires.updated_at desc")} ,:dependent => :destroy + has_many :tag_repertoires, ->{order(updated_at: :desc)} ,:dependent => :destroy end