From 41d704e3c664f53a07b60c5b336d7766e64c431b Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Sun, 29 Mar 2015 16:11:46 +0100 Subject: [PATCH] rm unused models --- models.rb | 65 ------------------------------------------------------- 1 file changed, 65 deletions(-) diff --git a/models.rb b/models.rb index cb2d8ba..dca7022 100644 --- a/models.rb +++ b/models.rb @@ -218,70 +218,5 @@ class Party has n, :campaigns end -# These models are now redundant - -class Ward - include DataMapper::Resource - - property :id, Serial - property :slug, String, :required => true - property :ons_id, String, :required => true - property :name, String, :required => true - property :constituency_id, Integer, :required => true - - has n, :councilcandidates, :order => ['surname'] - belongs_to :constituency - - def self.slugify(name) - name.gsub(/[^\w\s-]/, '').gsub(/\s+/, '-').downcase - end - -end - -class Councilcandidate - include DataMapper::Resource - - property :id, Serial - property :ward_id, Integer, :required => true - property :party_id, Integer, :required => true - property :forenames, String, :required => true - property :surname, String, :required => true - property :address, String, :length => 200 - property :postcode, String, :required => true - property :votes_2010, Integer - - belongs_to :party - belongs_to :ward -end - -class Parliamentcandidate - include DataMapper::Resource - - property :id, Serial - property :constituency_id, Integer, :required => true - property :party_id, Integer, :required => true - property :forenames, String, :required => true - property :surname, String, :required => true - property :address, String, :length => 200 - property :postcode, String - property :votes_2010, Integer - property :votes_2005, Integer - property :percent_2005, Float - - - belongs_to :party - belongs_to :constituency -end - -class Constituency - include DataMapper::Resource - - property :id, Serial - property :name, String, :required => true - - has n, :wards, :order => ['name'] - has n, :parliamentcandidates, :order => ['surname'] -end - DataMapper.setup(:default, ENV['DATABASE_URL'] || "postgres://postgres@localhost:5432/suttonelections") DataMapper.auto_upgrade!