forgeplus/app/models/trustie_hack.rb

11 lines
303 B
Ruby
Raw Normal View History

2020-03-09 00:40:16 +08:00
class TrustieHack < ApplicationRecord
validates_length_of :description, maximum: 500, message: "不能超过500个字符"
has_many :hack_users, :dependent => :destroy
belongs_to :trustie_hackathon, counter_cache: true
def entry_info(user_id)
hack_users.exists?(user_id: user_id)
end
end