pg_escape_bytea / pg_unescape_bytea (php) alternative in Rails?

bytea column values are automatically escaped and unescaped.

jeremy