소스 검색

Fixed bug with model orders as Strings rather than Arrays

tags/last-sinatra-version
Adrian Short 16 년 전
부모
커밋
b3a3ffb802
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. +4
    -4
      lib/models.rb

+ 4
- 4
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")

불러오는 중...
취소
저장