Skip to content

Instantly share code, notes, and snippets.

@pupca
Created March 2, 2011 02:24
Show Gist options
  • Save pupca/850348 to your computer and use it in GitHub Desktop.
Save pupca/850348 to your computer and use it in GitHub Desktop.
class CatalogArea
# == Schema Information
#
# Table name: catalog_areas
#
# id :integer(4) not null, primary key
# name :string(255)
end
class City
# == Schema Information
#
# Table name: cities
#
# id :integer(4) not null, primary key
# catalog_area_id :integer(4)
# name :string(255)
end
class Deal
# == Schema Information
#
# Table name: catalog_areas
#
# city :string(255)
end
#how should i do has_many and belongs_to to call this
CatalogArea.first.deals
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment