The ActiveRecord does this automatically, as necessary.
Or, I''ve been *very* lucky storing uploaded photos in a
BYTEA in PostgreSQL.
--
-- Tom Mornini
On Dec 21, 2005, at 4:38 AM, rickthemick wrote:
> Hi!
> I want to escape binary data correctly either manually or using some
> pre-defined function that does this for me!
>
> I have found on the web: PGconn.escape_bytea but I only get "undefined
> method". Any ideas, what is the correct way of doing this my self?
>
> I''m using Rails (WEBrick) under Windows XP with postgre-pr 0.4.0
>
> I have tried:
>
> s_buffer = s_buffer.gsub(/['']/, ''\\047'')
> s_buffer = s_buffer.gsub(/[\\]/, ''\\134'')
> s_buffer = s_buffer.gsub(/[\0]/, ''\\000'')
>
> /Rick
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails