diff options
author | Rhenium <rhenium@rhe.jp> | 2014-04-05 12:57:48 +0900 |
---|---|---|
committer | Rhenium <rhenium@rhe.jp> | 2014-04-05 12:57:48 +0900 |
commit | 3c393559691015b4fd58d584242a8b79e24c9e02 (patch) | |
tree | 335d8879a38d8d2e0c32317bff2314a380d62750 /app | |
parent | f09b60a8072bc26536b037f517ef9ac0f433f915 (diff) | |
download | aclog-3c393559691015b4fd58d584242a8b79e24c9e02.tar.gz |
fix Tweet.filter_by_query (don't use gsub!)
Diffstat (limited to 'app')
-rw-r--r-- | app/models/tweet.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/tweet.rb b/app/models/tweet.rb index 9229e10..d42576f 100644 --- a/app/models/tweet.rb +++ b/app/models/tweet.rb @@ -88,7 +88,7 @@ class Tweet < ActiveRecord::Base def filter_by_query(query) strings = [] - query.gsub!(/"((?:\\"|[^"])*?)"/) {|m| strings << $1; "##{strings.size - 1}" } + query = query.gsub(/"((?:\\"|[^"])*?)"/) {|m| strings << $1; "##{strings.size - 1}" } escape_text = -> str do str.gsub(/#(\d+)/) { strings[$1.to_i] } |