Skip to content

Instantly share code, notes, and snippets.

@pupca
Created March 2, 2011 01:45
Show Gist options
  • Save pupca/850307 to your computer and use it in GitHub Desktop.
Save pupca/850307 to your computer and use it in GitHub Desktop.
has_one :city_name, :primary_key => "city", :foreign_key => "name", :class_name => "City"
has_one :catalog_area, :through => :city_name
###
CatalogArea Load (0.4ms) SELECT `catalog_areas`.* FROM `catalog_areas` INNER JOIN `cities` ON `catalog_areas`.id = `cities`.catalog_area_id WHERE ((`cities`.name = 100)) LIMIT 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment