From b3a3ffb80209bbb9e36d41927d9ca1b70218b5f8 Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Fri, 16 Apr 2010 20:18:38 +0100 Subject: [PATCH] Fixed bug with model orders as Strings rather than Arrays --- lib/models.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/models.rb b/lib/models.rb index ef749d8..a366d9a 100644 --- a/lib/models.rb +++ b/lib/models.rb @@ -24,7 +24,7 @@ class Ward property :name, String, :required => true property :constituency_id, Integer, :required => true - has n, :councilcandidates, :order => 'surname' + has n, :councilcandidates, :order => [ 'surname' ] belongs_to :constituency def self.slugify(name) @@ -39,8 +39,8 @@ class Party property :id, Serial 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 class Councilcandidate @@ -80,7 +80,7 @@ class Constituency property :name, String, :required => true has n, :wards, :order => 'name' - has n, :parliamentcandidates, :order => 'surname' + has n, :parliamentcandidates, :order => [ 'surname' ] end DataMapper.setup(:default, ENV['DATABASE_URL'] || "sqlite3://#{Dir.pwd}/db.sqlite3")