Sha256: a86f35ed7e387edd49ad487e55d3dfb480adce24993e5896f0cae824d83a90ad

Contents?: true

Size: 357 Bytes

Versions: 66

Compression:

Stored size: 357 Bytes

Contents

class RoomAssignment < ActiveRecord::Base
  self.primary_keys = :student_id, :dorm_id, :room_id
  belongs_to :student
  belongs_to :room, :foreign_key => [:dorm_id, :room_id], :primary_key => [:dorm_id, :room_id]
  validates_uniqueness_of :student_id

  before_destroy do |record|
    puts record
  end

  after_destroy do |record|
    puts record
  end
end

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
composite_primary_keys-13.0.8 test/fixtures/room_assignment.rb
composite_primary_keys-14.0.4 test/fixtures/room_assignment.rb
composite_primary_keys-14.0.3 test/fixtures/room_assignment.rb
composite_primary_keys-13.0.3 test/fixtures/room_assignment.rb
composite_primary_keys-14.0.2 test/fixtures/room_assignment.rb
composite_primary_keys-13.0.2 test/fixtures/room_assignment.rb
composite_primary_keys-14.0.1 test/fixtures/room_assignment.rb
composite_primary_keys-9.0.9 test/fixtures/room_assignment.rb
composite_primary_keys-11.0.0.rc2 test/fixtures/room_assignment.rb
composite_primary_keys-10.0.3 test/fixtures/room_assignment.rb
composite_primary_keys-11.0.0.rc1 test/fixtures/room_assignment.rb
composite_primary_keys-11.0.0.beta4 test/fixtures/room_assignment.rb
composite_primary_keys-11.0.0.beta3 test/fixtures/room_assignment.rb
composite_primary_keys-11.0.0.beta2 test/fixtures/room_assignment.rb
composite_primary_keys-11.0.0.beta1 test/fixtures/room_assignment.rb
composite_primary_keys-10.0.2 test/fixtures/room_assignment.rb
composite_primary_keys-10.0.1 test/fixtures/room_assignment.rb
composite_primary_keys-9.0.8 test/fixtures/room_assignment.rb
composite_primary_keys-10.0.0 test/fixtures/room_assignment.rb
composite_primary_keys-9.0.7 test/fixtures/room_assignment.rb