Sha256: 202536b45f59048ff4382d56ce71d462db55fc71e1f61adb07e50d1fef5a233b

Contents?: true

Size: 351 Bytes

Versions: 16

Compression:

Stored size: 351 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]
  has_many :readings, :primary_key => :user_id, :foreign_key => :user_id
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
composite_primary_keys-3.1.11 test/fixtures/membership.rb
composite_primary_keys-5.0.0.rc1 test/fixtures/membership.rb
composite_primary_keys-4.1.2 test/fixtures/membership.rb
composite_primary_keys-4.1.1 test/fixtures/membership.rb
composite_primary_keys-4.0.0 test/fixtures/membership.rb
composite_primary_keys-4.0.0.beta9 test/fixtures/membership.rb
composite_primary_keys-4.0.0.beta8 test/fixtures/membership.rb
composite_primary_keys-4.0.0.beta7 test/fixtures/membership.rb
composite_primary_keys-4.0.0.beta6 test/fixtures/membership.rb
composite_primary_keys-4.0.0.beta5 test/fixtures/membership.rb
composite_primary_keys-4.0.0.beta4 test/fixtures/membership.rb
composite_primary_keys-4.0.0.beta3 test/fixtures/membership.rb
composite_primary_keys-3.1.10 test/fixtures/membership.rb
composite_primary_keys-4.0.0.beta2 test/fixtures/membership.rb
composite_primary_keys-4.0.0.beta1 test/fixtures/membership.rb
composite_primary_keys-3.1.9 test/fixtures/membership.rb