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