diff options
author | francis <francis> | 2008-03-15 04:19:03 +0000 |
---|---|---|
committer | francis <francis> | 2008-03-15 04:19:03 +0000 |
commit | 0a423eae84d6c2b123a50d2c7e8195a873aa224a (patch) | |
tree | 0b1a4e8832e63dbd7389bb9f5de5f94d518415f3 /app/models/info_request.rb | |
parent | cb40d0436a2e19beaad0ec2715da97e9b8086527 (diff) |
Add tests for broken case of saving info request or user when there is existing one with same title/name.
Fix the bug, which was in function that makes url_title/url_name.
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index 2539e4d60..4d1d577dc 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -22,7 +22,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: info_request.rb,v 1.65 2008-03-14 10:03:20 francis Exp $ +# $Id: info_request.rb,v 1.66 2008-03-15 04:19:04 francis Exp $ require 'digest/sha1' @@ -145,7 +145,7 @@ public url_title = url_title[0..31] end # For request with same name as others, tag on the request numeric id - while not InfoRequest.find_by_url_title(url_title, :conditions => ["id <> ?", self.id] ).nil? + while not InfoRequest.find_by_url_title(url_title, :conditions => self.id.nil? ? nil : ["id <> ?", self.id] ).nil? url_title += "_" + self.id.to_s end write_attribute(:url_title, url_title) |