aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/censor_rule.rb6
-rw-r--r--app/models/incoming_message.rb7
-rw-r--r--app/models/info_request_event.rb4
3 files changed, 8 insertions, 9 deletions
diff --git a/app/models/censor_rule.rb b/app/models/censor_rule.rb
index de8c699a6..18a962dfc 100644
--- a/app/models/censor_rule.rb
+++ b/app/models/censor_rule.rb
@@ -21,7 +21,7 @@
# Copyright (c) 2008 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: censor_rule.rb,v 1.9 2009-03-09 15:48:32 tony Exp $
+# $Id: censor_rule.rb,v 1.10 2009-04-08 05:34:52 francis Exp $
class CensorRule < ActiveRecord::Base
belongs_to :info_request
@@ -32,7 +32,7 @@ class CensorRule < ActiveRecord::Base
if text.nil?
return nil
end
- text.gsub!(self.text, self.replacement)
+ text = text.gsub(self.text, self.replacement)
return text
end
def apply_to_binary(binary)
@@ -40,7 +40,7 @@ class CensorRule < ActiveRecord::Base
return nil
end
replacement = self.text.gsub(/./, 'x')
- binary.gsub!(self.text, replacement)
+ binary = binary.gsub(self.text, replacement)
return binary
end
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 002914bca..819d6c5b5 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -19,7 +19,7 @@
# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved.
# Email: francis@mysociety.org; WWW: http://www.mysociety.org/
#
-# $Id: incoming_message.rb,v 1.197 2009-04-08 05:29:35 francis Exp $
+# $Id: incoming_message.rb,v 1.198 2009-04-08 05:34:52 francis Exp $
# TODO
# Move some of the (e.g. quoting) functions here into rblib, as they feel
@@ -241,7 +241,7 @@ class FOIAttachment
filename = self._internal_display_filename
# Remove slashes, they mess with URLs
- filename.gsub!(/\//, "-")
+ filename = filename.gsub(/\//, "-")
return filename
end
@@ -619,7 +619,6 @@ class IncomingMessage < ActiveRecord::Base
return text
end
- # Flattens all the attachments, picking only one part where there are alternatives.
# (This risks losing info if the unchosen alternative is the only one to contain
# useful info, but let's worry about that another time)
def get_attachment_leaves
@@ -724,7 +723,7 @@ class IncomingMessage < ActiveRecord::Base
begin
# XXX specially convert unicode pound signs, was needed here
# http://www.whatdotheyknow.com/request/88/response/352
- text.gsub!("£", Iconv.conv(text_charset, 'utf-8', '£'))
+ text = text.gsub("£", Iconv.conv(text_charset, 'utf-8', '£'))
# Try proper conversion
text = Iconv.conv('utf-8', text_charset, text)
rescue Iconv::IllegalSequence, Iconv::InvalidEncoding
diff --git a/app/models/info_request_event.rb b/app/models/info_request_event.rb
index ef8bff164..efb58930b 100644
--- a/app/models/info_request_event.rb
+++ b/app/models/info_request_event.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: info_request_event.rb,v 1.77 2009-03-09 15:48:32 tony Exp $
+# $Id: info_request_event.rb,v 1.78 2009-04-08 05:34:52 francis Exp $
class InfoRequestEvent < ActiveRecord::Base
belongs_to :info_request
@@ -106,7 +106,7 @@ class InfoRequestEvent < ActiveRecord::Base
url_title = self.info_request.url_title
# remove numeric section from the end, use this to group lots
# of similar requests by
- url_title.gsub!(/[_0-9]+$/, "")
+ url_title = url_title.gsub(/[_0-9]+$/, "")
return url_title
end
def described_at