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-11.2.0 test/fixtures/suburb.rb
composite_primary_keys-11.1.0 test/fixtures/suburb.rb
composite_primary_keys-11.0.3 test/fixtures/suburb.rb
composite_primary_keys-11.0.2 test/fixtures/suburb.rb
composite_primary_keys-10.0.5 test/fixtures/suburb.rb
composite_primary_keys-9.0.10 test/fixtures/suburb.rb
composite_primary_keys-11.0.1 test/fixtures/suburb.rb
composite_primary_keys-11.0.0 test/fixtures/suburb.rb
composite_primary_keys-10.0.4 test/fixtures/suburb.rb
composite_primary_keys-9.0.9 test/fixtures/suburb.rb
composite_primary_keys-10.0.3 test/fixtures/suburb.rb
composite_primary_keys-11.0.0.rc1 test/fixtures/suburb.rb
composite_primary_keys-11.0.0.beta4 test/fixtures/suburb.rb
composite_primary_keys-11.0.0.beta3 test/fixtures/suburb.rb
composite_primary_keys-11.0.0.beta2 test/fixtures/suburb.rb
composite_primary_keys-11.0.0.beta1 test/fixtures/suburb.rb
composite_primary_keys-10.0.2 test/fixtures/suburb.rb
composite_primary_keys-10.0.1 test/fixtures/suburb.rb
composite_primary_keys-9.0.8 test/fixtures/suburb.rb
composite_primary_keys-10.0.0 test/fixtures/suburb.rb