ActiveSupport::SafeBufferからStringオブジェクトを取得したい。メソッドto_sは、同じタイプのActiveSupport::SafeBufferを返します。to_sym.to_sのみがStringを返しますが、これはもっとハックです。これが私のコンソールの再生です:
irb(main):008:0> s = ActiveSupport::SafeBuffer.new("asdf")
# => "asdf"
irb(main):009:0> s.class
# => ActiveSupport::SafeBuffer
irb(main):010:0> s.to_s.class
# => ActiveSupport::SafeBuffer
irb(main):011:0> s.to_sym.to_s
# => "asdf"
irb(main):012:0> s.to_sym.to_s.class
# => String