From 0675495fa7d68b22dfa66300e9b25a084e543c56 Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Sun, 29 Mar 2015 16:31:52 +0100 Subject: [PATCH] Restore Ward model --- models.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/models.rb b/models.rb index dca7022..8c009e6 100644 --- a/models.rb +++ b/models.rb @@ -218,5 +218,18 @@ class Party has n, :campaigns end +class Ward + include DataMapper::Resource + + property :id, Serial + property :slug, String, :required => true + property :ons_id, String, :required => true + property :name, String, :required => true + + def self.slugify(name) + name.gsub(/[^\w\s-]/, '').gsub(/\s+/, '-').downcase + end +end + DataMapper.setup(:default, ENV['DATABASE_URL'] || "postgres://postgres@localhost:5432/suttonelections") DataMapper.auto_upgrade!