Sha256: ad799d657e1ae6ef8a94ba19df0b016b4911a4977ca45b6ece8c7694d0e28203

Contents?: true

Size: 293 Bytes

Versions: 54

Compression:

Stored size: 293 Bytes

Contents

class Suburb < ActiveRecord::Base
  self.primary_keys = :city_id, :suburb_id
  has_many :streets,  :foreign_key => [:city_id, :suburb_id]
  has_many :first_streets, -> {where("streets.name = 'First Street'")},
           :foreign_key => [:city_id, :suburb_id], :class_name => 'Street'
end

Version data entries

54 entries across 54 versions & 1 rubygems

Version Path
composite_primary_keys-13.0.1 test/fixtures/suburb.rb
composite_primary_keys-13.0.0 test/fixtures/suburb.rb
composite_primary_keys-12.0.10 test/fixtures/suburb.rb
composite_primary_keys-12.0.9 test/fixtures/suburb.rb
composite_primary_keys-12.0.8 test/fixtures/suburb.rb
composite_primary_keys-12.0.6 test/fixtures/suburb.rb
composite_primary_keys-12.0.5 test/fixtures/suburb.rb
composite_primary_keys-12.0.4 test/fixtures/suburb.rb
composite_primary_keys-12.0.3 test/fixtures/suburb.rb
composite_primary_keys-12.0.2 test/fixtures/suburb.rb
composite_primary_keys-11.3.1 test/fixtures/suburb.rb
composite_primary_keys-8.1.8 test/fixtures/suburb.rb
composite_primary_keys-12.0.1 test/fixtures/suburb.rb
composite_primary_keys-12.0.0 test/fixtures/suburb.rb
composite_primary_keys-12.0.0.rc5 test/fixtures/suburb.rb
composite_primary_keys-12.0.0.rc4 test/fixtures/suburb.rb
composite_primary_keys-12.0.0.rc3 test/fixtures/suburb.rb
composite_primary_keys-12.0.0.rc2 test/fixtures/suburb.rb
composite_primary_keys-12.0.0.rc1 test/fixtures/suburb.rb
composite_primary_keys-8.1.7 test/fixtures/suburb.rb