Created
November 30, 2010 17:33
-
-
Save amuino/722028 to your computer and use it in GitHub Desktop.
This code used to work, but breaks in 3.0.3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Something in rails 3.0.3 broke mysql2. | |
It seems to also break some other gems: | |
https://github.com/ProtectedMethod/restful_acl/issues/issue/9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html_escape(tweet.text). | |
gsub(/(http:\/\/[^ ]+)/i) do |m| | |
link = link_to_outside(image_tag('external_link.png', :alt => "original link"), m) | |
end.gsub(/@[a-z_0-9]+/i) do |m| | |
u = User.find_by_twitter_handle(m[1..-1]) | |
u ? link_to_user(u) : m | |
end.gsub(/(#[a-z_0-9]+)/i) do |m| | |
"<span class='hashtag'>#{m}</span>" | |
end.html_safe | |
# -- | |
# undefined method `visit_ActiveSupport_SafeBuffer' for #<Arel::Visitors::MySQL:0x105e24cc0> | |
# -- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html_escape(tweet.text). | |
gsub(/(http:\/\/[^ ]+)/i) do |m| | |
link = link_to_outside(image_tag('external_link.png', :alt => "original link"), m) | |
end.gsub(/@[a-z_0-9]+/i) do |m| | |
u = User.find_by_twitter_handle(String.new(m[1..-1])) | |
u ? link_to_user(u) : m | |
end.gsub(/(#[a-z_0-9]+)/i) do |m| | |
"<span class='hashtag'>#{m}</span>" | |
end.html_safe | |
# -- | |
# note the use of String.new, since to_s will not work | |
# -- |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment