Sha256: bbb941d10086da08d8023c4847030b7c8553a1483cedd1311dcfad0a59109a44
Contents?: true
Size: 657 Bytes
Versions: 22
Compression:
Stored size: 657 Bytes
Contents
class Player include Mongoid::Document field :active, :type => Boolean field :frags, :type => Integer field :deaths, :type => Integer field :status named_scope :active, criteria.where(:active => true) do def extension "extension" end end named_scope :inactive, :where => { :active => false } named_scope :frags_over, lambda { |count| { :where => { :frags.gt => count } } } named_scope :deaths_under, lambda { |count| criteria.where(:deaths.lt => count) } scope :deaths_over, lambda { |count| criteria.where(:deaths.gt => count) } class << self def alive criteria.where(:status => "Alive") end end end
Version data entries
22 entries across 22 versions & 4 rubygems