|
|
|
@ -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}%") }
|
|
|
|
|