Sha256: c22888121c8edaf5f6f9ea05cf34d7c5b28895e164b69f4605a304e33a784de8

Contents?: true

Size: 450 Bytes

Versions: 3

Compression:

Stored size: 450 Bytes

Contents

module Clubhouse
  module Concerns
    module Models
      module Membership
        extend ActiveSupport::Concern

        included do
          belongs_to :member, class_name: Clubhouse.config.member_model
          belongs_to :organization

          validates :member, presence: true
          validates :organization, presence: true
          validates :member_id, uniqueness: { scope: :organization_id }
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
clubhouse-0.3.0 lib/clubhouse/concerns/models/membership.rb
clubhouse-0.2.0 lib/clubhouse/concerns/models/membership.rb
clubhouse-0.1.0 lib/clubhouse/concerns/models/membership.rb