Sha256: a5633eeede1ccde8b6a54481c2db2138e8c9c1a6c408783b651f71ce3d34b4ce
Contents?: true
Size: 303 Bytes
Versions: 20
Compression:
Stored size: 303 Bytes
Contents
class Team < ActiveRecord::Base has_and_belongs_to_many :people validates :name, presence: true validate :no_more_than_two_people_per_team def no_more_than_two_people_per_team if people.length > 2 errors.add(:people, "A maximum of two persons per team is allowed") end end end
Version data entries
20 entries across 20 versions & 1 rubygems