|
|
|
@ -21,6 +21,8 @@ class Hack < ApplicationRecord
|
|
|
|
|
belongs_to :user
|
|
|
|
|
belongs_to :sub_discipline
|
|
|
|
|
|
|
|
|
|
has_one :item_bank, as: :container, dependent: :destroy
|
|
|
|
|
|
|
|
|
|
scope :published, -> { where(status: 1) }
|
|
|
|
|
scope :unpublish, -> { where(status: 0) }
|
|
|
|
|
scope :opening, -> {where(open_or_not: 1)}
|
|
|
|
|