Skip to content

Latest commit

 

History

History
35 lines (17 loc) · 841 Bytes

File metadata and controls

35 lines (17 loc) · 841 Bytes

Helps with writing PostGIS addresses.

This is a simple address model that is useful for using in all applications that need a good geo reference. This class strives to be GIS, but is a work in progress. The GIS functions (acts_as_geom) will only work with PostGIS and Postgresql.

Install the plugin:

$ script/plugin install git://github.com/markmcdonald51/addressable.git

Run the migration

$ script/generate address_migration new

I use this in many of my models as an addressable polymorphic association as such:

has_one :address, :as => :addressable, 
  :class_name => 'Address', :dependent => :destroy

or

has_many :addresses, :as => :addressable,  
  :class_name => 'Address', :dependent => :destroy