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-7.0.12 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.11 test/fixtures/room_assignment.rb
composite_primary_keys-6.0.7 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.10 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.9 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.8 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.7 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.6 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.5 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.4 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.3 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.2 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.1 test/fixtures/room_assignment.rb
composite_primary_keys-7.0.0 test/fixtures/room_assignment.rb
composite_primary_keys-6.0.6 test/fixtures/room_assignment.rb
composite_primary_keys-6.0.5 test/fixtures/room_assignment.rb
composite_primary_keys-6.0.3 test/fixtures/room_assignment.rb
composite_primary_keys-5.0.14 test/fixtures/room_assignment.rb
composite_primary_keys-6.0.1 test/fixtures/room_assignment.rb
composite_primary_keys-6.0.0 test/fixtures/room_assignment.rb