API de comptabilité horaire.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

membership.rb 312B

1234567891011
  1. class Membership < ApplicationRecord
  2. attr_readonly :member
  3. attr_readonly :team
  4. validates :member, presence: :true
  5. validates :team, presence: :true
  6. validates_uniqueness_of :member, scope: :team, message: "user already part of this team"
  7. belongs_to :member, class_name: 'User'
  8. belongs_to :team
  9. end