Sha256: 6a2712e4348fe04f76d57a828f77edf67f5f659980faee23b9be1269bc575677

Contents?: true

Size: 655 Bytes

Versions: 17

Compression:

Stored size: 655 Bytes

Contents

class Team < Sequel::Model
  set_primary_key(:id)
  plugin(:timestamps, :update_on_create => true)
  plugin(:validation_helpers)

  many_to_one(:league)
  many_to_one(:division)
  one_to_many(:players)

  self.raise_on_save_failure = false
  self.raise_on_typecast_failure = false
  def validate
    validates_numeric(:league_id, :only_integer => true)
    validates_numeric(:division_id, :only_integer => true)
    validates_presence(:manager)
    validates_numeric(:founded, :only_integer => true)
    validates_numeric(:wins, :only_integer => true)
    validates_numeric(:losses, :only_integer => true)
    validates_numeric(:win_percentage)
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
merb-admin-0.8.8 spec/models/sequel/team.rb
merb-admin-0.8.7 spec/models/sequel/team.rb
merb-admin-0.8.6 spec/models/sequel/team.rb
merb-admin-0.8.1 spec/models/sequel/team.rb
merb-admin-0.8.0 spec/models/sequel/team.rb
merb-admin-0.7.6 spec/models/sequel/team.rb
merb-admin-0.7.5 spec/models/sequel/team.rb
merb-admin-0.7.4 spec/models/sequel/team.rb
merb-admin-0.7.3 spec/models/sequel/team.rb
merb-admin-0.7.2 spec/models/sequel/team.rb
merb-admin-0.7.1 spec/models/sequel/team.rb
merb-admin-0.7.0 spec/models/sequel/team.rb
merb-admin-0.6.9 spec/models/sequel/team.rb
merb-admin-0.6.8 spec/models/sequel/team.rb
merb-admin-0.6.7 spec/models/sequel/team.rb
merb-admin-0.6.6 spec/models/sequel/team.rb
merb-admin-0.6.5 spec/models/sequel/team.rb