Ver a proveniência

rm unused models

tags/last-sinatra-version
Adrian Short há 9 anos
ascendente
cometimento
41d704e3c6
1 ficheiros alterados com 0 adições e 65 eliminações
  1. +0
    -65
      models.rb

+ 0
- 65
models.rb Ver ficheiro

@@ -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!

Carregando…
Cancelar
Guardar