|
|
|
@ -62,13 +62,18 @@ class Shixun < ActiveRecord::Base
|
|
|
|
|
|
|
|
|
|
include ApplicationHelper
|
|
|
|
|
has_many :tidings, :as => :container, :dependent => :destroy
|
|
|
|
|
scope :visible, -> { where(status: -1) }
|
|
|
|
|
#scope :visible, -> { where(status: -1) }
|
|
|
|
|
after_create :send_tiding
|
|
|
|
|
|
|
|
|
|
def should_compile?
|
|
|
|
|
self.mirror_repositories.published_main_mirror.first.try(:should_compile)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
# 可供使用的实训
|
|
|
|
|
def operable?
|
|
|
|
|
self.status != -1 && !self.hidden
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
def is_published?
|
|
|
|
|
self.status > 1 ? true : false
|
|
|
|
|
end
|
|
|
|
|