I think the problem is that the binary fixture data did not get
escaped properly in PostgreSQL adapter because yaml_db did not provide
the correct column type to it. It is the same case for most Rails's
db:fixtures:load.

It was suggested in 
http://www.realityforge.org/articles/2006/04/06/loading-binary-data-into-rails-fixtures
that we override the PostgreSQL adapter quote() to add our binary data
checking for "db:data:load" or "db:fixtures:load", but it did not work
for me (maybe Rails version problem). Here is what I did to make
things perfect:

class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter <
ActiveRecord::ConnectionAdapters::AbstractAdapter
  def quote(value, column = nil)
    if (value.kind_of?(String) && column && column.type == :binary) ||
(value.kind_of?(String) && value.include?(0))

"#{quoted_string_prefix}'#{ActiveRecord::ConnectionAdapters::PostgreSQLColumn.string_to_binary(value)}'"
    else
      super
    end
  end
end

Good luck! And thanks to the great plugin.

On Apr 15, 4:49 am, "Adam Wiggins" <[EMAIL PROTECTED]> wrote:
> I don't think yaml_db properly handles UTF8 yet.  We haven't looked
> into this too deeply yet - might be a yaml issue, might be a database
> issue, might be a ruby/rails issue.  But yaml_db is open source so
> fixing this is a chance for someone out there to achieve some brief
> community glory... *hint* *hint* :)
>
> Adam
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Heroku" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/heroku?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to