Skip to content

Instantly share code, notes, and snippets.

@smathy
Forked from pupca/gist:850348
Created March 2, 2011 02:30
Show Gist options
  • Save smathy/850358 to your computer and use it in GitHub Desktop.
Save smathy/850358 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