client_management/app/models/server_ability.rb

9 lines
242 B
Ruby

class ServerAbility
include Mongoid::Document
include Mongoid::Timestamps
field :ability, type: Integer, default: 0
field :site_num, type: Integer, default: 0
def available
self.ability==0 || self.site_num<self.ability
end
end