Models and data for Polish cities, regions, communities, counties
Ruby
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
generators/pl_cities
lib
tasks
test
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

= PL Cities

This plugin contains ActiveRecord Models and fixtures for Polish cities, regions, communities and counties (miasta, województwa, gminy i powiaty).

This is beta version. Please check and let me know if something doesn't work ;)

== Install
  
  Plugin generator will generate migrations for tables named [city, community,county, region] 
  so if you already have same tables you need to rename them!
  
  Migration & Data
  
  ./script/generate pl_cities
  rake db:migrate
  rake db:fixtures:load

== Example

  >> city = City.find_by_name("Szczecin")
  => #<City id: 896, region_id: 32, county_id: 62, community_id: 1, name: "Szczecin", created_at: "2010-03-15 17:30:01", updated_at: "2010-03-15 17:30:01">

  >> region = city.region
  => #<Region id: 16, country_id: 161, code: 32, name: "zachodniopomorskie", name_ext: "województwo", created_at: "2010-03-15 17:30:04", updated_at: "2010-03-15 17:30:04">

  >> counties = region.communities
  List of communities in West Pomeranian Voivodship


== Contact

Any bugs, questions, comments please feel free to email me : boguslaw.tarnowski@gmail.com

Copyright (c) 2010,  Boguslaw Tarnowski, released under the MIT license