openstreetmap-website/vendor/gems/composite_primary_keys-2.2.2/test/fixtures/suburb.rb
2010-04-19 15:17:18 +01:00

6 lines
No EOL
289 B
Ruby

class Suburb < ActiveRecord::Base
set_primary_keys :city_id, :suburb_id
has_many :streets, :foreign_key => [:city_id, :suburb_id]
has_many :first_streets, :foreign_key => [:city_id, :suburb_id],
:class_name => 'Street', :conditions => "streets.name = 'First Street'"
end