Sha256: 84acc80c87e2c48971be36b6b265834f8131b88c42bd9d91c07a73043b8263e8

Contents?: true

Size: 278 Bytes

Versions: 33

Compression:

Stored size: 278 Bytes

Contents

class Membership < ActiveRecord::Base
  # set_primary_keys *keys - turns on composite key functionality
  set_primary_keys :user_id, :group_id
  belongs_to :user
	belongs_to :group
	has_many :statuses, :class_name => 'MembershipStatus', :foreign_key => [:user_id, :group_id]
end

Version data entries

33 entries across 33 versions & 4 rubygems

Version Path
composite_primary_keys-0.8.3 test/fixtures/membership.rb
composite_primary_keys-1.0.2 test/fixtures/membership.rb
composite_primary_keys-0.9.93 test/fixtures/membership.rb
composite_primary_keys-0.9.92 test/fixtures/membership.rb
composite_primary_keys-2.2.1 test/fixtures/membership.rb
composite_primary_keys-2.2.2 test/fixtures/membership.rb
composite_primary_keys-1.0.8 test/fixtures/membership.rb
composite_primary_keys-1.0.5 test/fixtures/membership.rb
composite_primary_keys-1.0.4 test/fixtures/membership.rb
composite_primary_keys-1.0.6 test/fixtures/membership.rb
composite_primary_keys-1.0.7 test/fixtures/membership.rb
composite_primary_keys-1.1.0 test/fixtures/membership.rb
composite_primary_keys-2.2.0 test/fixtures/membership.rb