View difference between Paste ID: bPwfUZgi and egM9aqb9
SHOW: | | - or go back to the newest paste.
1
class CatalogArea
2
# == Schema Information
3
#
4
# Table name: catalog_areas
5
#
6
#  id               :integer(4)      not null, primary key
7
#  name       :string(255)
8
9
end
10
11
class City
12
# == Schema Information
13
#
14
# Table name: cities
15
#
16
#  id               :integer(4)      not null, primary key
17
#  catalog_area_id  :integer(4)
18
#  name       :string(255)
19
end
20
21
class Deal
22
# == Schema Information
23
#
24
# Table name: catalog_areas
25
#
26
#  city       :string(255)
27
28
end
29
30
#how should i do has_many and belongs_to to call this
31
CatalogArea.first.deals