|
@@ -24,7 +24,7 @@ class Ward |
|
|
property :name, String, :required => true |
|
|
property :name, String, :required => true |
|
|
property :constituency_id, Integer, :required => true |
|
|
property :constituency_id, Integer, :required => true |
|
|
|
|
|
|
|
|
has n, :councilcandidates, :order => 'surname' |
|
|
|
|
|
|
|
|
has n, :councilcandidates, :order => [ 'surname' ] |
|
|
belongs_to :constituency |
|
|
belongs_to :constituency |
|
|
|
|
|
|
|
|
def self.slugify(name) |
|
|
def self.slugify(name) |
|
@@ -39,8 +39,8 @@ class Party |
|
|
property :id, Serial |
|
|
property :id, Serial |
|
|
property :name, String, :required => true |
|
|
property :name, String, :required => true |
|
|
|
|
|
|
|
|
has n, :councilcandidates, :order => 'surname' |
|
|
|
|
|
has n, :parliamentcandidates, :order => 'surname' |
|
|
|
|
|
|
|
|
has n, :councilcandidates, :order => [ 'surname' ] |
|
|
|
|
|
has n, :parliamentcandidates, :order => [ 'surname' ] |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
class Councilcandidate |
|
|
class Councilcandidate |
|
@@ -80,7 +80,7 @@ class Constituency |
|
|
property :name, String, :required => true |
|
|
property :name, String, :required => true |
|
|
|
|
|
|
|
|
has n, :wards, :order => 'name' |
|
|
has n, :wards, :order => 'name' |
|
|
has n, :parliamentcandidates, :order => 'surname' |
|
|
|
|
|
|
|
|
has n, :parliamentcandidates, :order => [ 'surname' ] |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/db.sqlite3") |
|
|
DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/db.sqlite3") |