* Remove deprecated analytics role * Make anchor tag a bit more readable * Add OrganizationMembership table and model * Add organization_membership associations * Add unique indices for user_id and org_id * Wrap update and create calls in transactions * Remove specs of deprecated analytics_beta_tester
5 lines
254 B
Ruby
5 lines
254 B
Ruby
class OrganizationMembership < ApplicationRecord
|
|
validates :user_id, :organization_id, :type_of_user, presence: true
|
|
validates :user_id, uniqueness: { scope: :organization_id }
|
|
validates :type_of_user, inclusion: { in: %w[admin member guest] }
|
|
end
|