diff --git a/app/models/shixun.rb b/app/models/shixun.rb index 7e267bd90..e0feb80ce 100644 --- a/app/models/shixun.rb +++ b/app/models/shixun.rb @@ -48,7 +48,7 @@ class Shixun < ApplicationRecord has_many :tidings, as: :container, dependent: :destroy # 实训审核记录 - has_many :shixun_reviews, -> {order("challenges.created_at desc")}, :dependent => :destroy + has_many :shixun_reviews, -> {order("shixun_reviews.created_at desc")}, :dependent => :destroy scope :search_by_name, ->(keyword) { where("name like ? or description like ? ", "%#{keyword}%", "%#{keyword}%") }