diff options
author | Robin Houston <robin.houston@gmail.com> | 2012-08-20 15:25:00 +0100 |
---|---|---|
committer | Robin Houston <robin.houston@gmail.com> | 2012-08-20 15:25:00 +0100 |
commit | f2115fe4357d232d0e8a373881790a9a38ee80f5 (patch) | |
tree | 7a3f03a56f906cca7b5d491ce2c017caa329a2f1 /app/models/info_request.rb | |
parent | c0c986ea983c55beff44f835adfcdead8b42ec18 (diff) |
Fail with NotFound if request slug doesn't exist
Closes #554.
Diffstat (limited to 'app/models/info_request.rb')
-rw-r--r-- | app/models/info_request.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/app/models/info_request.rb b/app/models/info_request.rb index ba7e44c08..23e18b858 100644 --- a/app/models/info_request.rb +++ b/app/models/info_request.rb @@ -223,7 +223,7 @@ class InfoRequest < ActiveRecord::Base incoming_message.clear_in_database_caches! end end - + # For debugging def InfoRequest.profile_search(query) t = Time.now.usec @@ -246,7 +246,9 @@ public # For request with same title as others, add on arbitary numeric identifier unique_url_title = url_title suffix_num = 2 # as there's already one without numeric suffix - while not InfoRequest.find_by_url_title(unique_url_title, :conditions => self.id.nil? ? nil : ["id <> ?", self.id] ).nil? + while not InfoRequest.find_by_url_title(unique_url_title, + :conditions => self.id.nil? ? nil : ["id <> ?", self.id] + ).nil? unique_url_title = url_title + "_" + suffix_num.to_s suffix_num = suffix_num + 1 end |