aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/models/outgoing_message.rb6
-rw-r--r--app/models/user.rb5
2 files changed, 6 insertions, 5 deletions
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb
index a4cb510bb..61990f2e6 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.rb
@@ -21,7 +21,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: outgoing_message.rb,v 1.62 2008-08-31 15:10:16 francis Exp $
+# $Id: outgoing_message.rb,v 1.63 2008-09-22 02:29:14 francis Exp $
class OutgoingMessage < ActiveRecord::Base
belongs_to :info_request
@@ -90,7 +90,7 @@ class OutgoingMessage < ActiveRecord::Base
# Check have edited letter
def validate
- if self.body.empty? || self.body =~ /\A#{get_salutation}\s+#{get_signoff}\s+/
+ if self.body.empty? || self.body =~ /\A#{get_salutation}\s+#{get_signoff}/
if self.message_type == 'followup'
errors.add(:body, "^Please enter your follow up message")
elsif
@@ -99,7 +99,7 @@ class OutgoingMessage < ActiveRecord::Base
raise "Message id #{self.id} has type '#{self.message_type}' which validate can't handle"
end
end
- if self.body =~ /#{get_signoff}\s+\Z/
+ if self.body =~ /#{get_signoff}\s*\Z/ms
errors.add(:body, '^Please sign at the bottom with your name, or alter the "' + get_signoff + '" signature')
end
end
diff --git a/app/models/user.rb b/app/models/user.rb
index c14913d73..a3761d425 100644
--- a/app/models/user.rb
+++ b/app/models/user.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: user.rb,v 1.68 2008-09-13 22:06:58 francis Exp $
+# $Id: user.rb,v 1.69 2008-09-22 02:29:14 francis Exp $
require 'digest/sha1'
@@ -171,7 +171,8 @@ class User < ActiveRecord::Base
return u
end
- # Returns list of requests which the user hasn't described.
+ # Returns list of requests which the user hasn't described (and last
+ # changed more than a day ago)
def get_undescribed_requests
self.info_requests.find(
:all,