public
Description: open-source e-commerce built on merb
Clone URL: git://github.com/myabc/merb_mart.git
Search Repo:
Click here to lend your support to: merb_mart and make a donation at www.pledgie.com !
myabc (author)
Thu May 08 03:15:21 -0700 2008
commit  72213a301782666f2277ba78d342274676328233
tree    814b722a9527d1e15ccc4313fcfb168e5081bbb6
parent  8388fe58541d56708c0b85fcc0e940d7946c9179
merb_mart / app / models / state.rb
100644 26 lines (21 sloc) 0.798 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#
# A representation of a State, Province, or sub-national administrative
# division, for those countries that use such administrative divisions.
#
# Useful for the purposes of addresses, local taxation purposes, etc.
#
# e.g.
# US State => New York/NY
# Canadian Province => Alberta/AB
# UK Province/Constituent Country => Northern Ireland
# German Bundesland => Baden-Württemburg/BW
#
class State
 
  include DataMapper::Resource
 
  property :id, Fixnum, :serial => true
  property :abbr, String, :length => 10
  property :name, String, :length => 50, :nullable => false
  property :country_code, String # foreign-key
  
  ## TODO country_code and abbr a composite-key
  
  belongs_to :country
  
end