|
|
@ -8,7 +8,7 @@ class HackUserLastestCode < ApplicationRecord
|
|
|
|
belongs_to :user
|
|
|
|
belongs_to :user
|
|
|
|
has_many :hack_user_codes, dependent: :destroy
|
|
|
|
has_many :hack_user_codes, dependent: :destroy
|
|
|
|
has_one :hack_user_debug
|
|
|
|
has_one :hack_user_debug
|
|
|
|
scope :mine, ->(author_id){ find_by(user_id: author_id) }
|
|
|
|
scope :mine, ->(author_id){ where(user_id: author_id).first }
|
|
|
|
scope :mine_hack, ->(author_id){ where(user_id: author_id) }
|
|
|
|
scope :mine_hack, ->(author_id){ where(user_id: author_id) }
|
|
|
|
scope :passed, -> {where(status: 1)}
|
|
|
|
scope :passed, -> {where(status: 1)}
|
|
|
|
|
|
|
|
|
|
|
|