Ruby weird assignment behaviour

Posted by jaycode on Stack Overflow See other posts from Stack Overflow or by jaycode
Published on 2010-06-12T16:07:35Z Indexed on 2010/06/12 16:13 UTC
Read the original article Hit count: 222

Filed under:
|

Is this a ruby bug?

target_url_to_edit = target_url

if target_url_to_edit.include?("http://")
  target_url_to_edit["http://"] = ""
end

logger.debug "target url is now #{target_url}"

This returns target_url without http://

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about bugs