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

Version Path
mongoid_spacial-0.2.17 spec/models/player.rb
sig_mongoid_spacial-0.2.17 spec/models/player.rb
cb_mongoid_spacial-0.2.16 spec/models/player.rb
mongoid_geospatial-1.0.0 spec/models/player.rb
mongoid_geospatial-1.0.0rc1 spec/models/player.rb
mongoid_geospatial-1.0.0rc0 spec/models/player.rb
mongoid_spacial-0.2.16 spec/models/player.rb
mongoid_spacial-0.2.13 spec/models/player.rb
mongoid_spacial-0.2.12 spec/models/player.rb
mongoid_spacial-0.2.11 spec/models/player.rb
mongoid_spacial-0.2.10 spec/models/player.rb
mongoid_spacial-0.2.8 spec/models/player.rb
mongoid_spacial-0.2.7 spec/models/player.rb
mongoid_spacial-0.2.6 spec/models/player.rb
mongoid_spacial-0.2.5 spec/models/player.rb
mongoid_spacial-0.2.4 spec/models/player.rb
mongoid_spacial-0.2.3 spec/models/player.rb
mongoid_spacial-0.2.2 spec/models/player.rb
mongoid_spacial-0.2.0 spec/models/player.rb
mongoid_spacial-0.1.1 spec/models/player.rb