You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
educoder/app/models/mirror_repository.rb

12 lines
439 B

6 years ago
class MirrorRepository < ApplicationRecord
has_many :shixun_mirror_repositories, :dependent => :destroy
has_many :shixun, :through => :shixun_mirror_repositories
has_many :mirror_scripts, :dependent => :destroy
scope :published_mirror, -> { where(status: 1) }
scope :published_main_mirror, -> { published_mirror.where(main_type: 1) }
scope :published_small_mirror, -> { published_mirror.where(main_type: 0) }
end