This project is archived and is in readonly mode.
Postgres ActiveRecord adapter merges UTF8 encoding as symbol instead of string in create_database
-
science
There is a related ticket to this one: http://rails.lighthouseapp.com/p...
In order to fix both problems, I think the following monkey patch does the trick. However, I have the patch from the other ticket and this one running in the environment.rb file (after the regular Initializer section runs):
class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter old_create_database = self.instance_method(:create_database) define_method(:create_database) do |name, *args| args[0] = (args[0] || {}).symbolize_keys old_create_database.bind(self).call(name, *args) end end -
science
Note - from my last comment, it sounds like I'm not sure that the above patch works - it is working for me. What's not clear is that it effectively fixes both tickets. It definitely corrects the defect described in this ticket.
-
Pratik
- Assigned user set to Tarmo Tänav
- State changed from new to incomplete
Could you please submit a patch + failing test case - http://rails.lighthouseapp.com/p... ?
Thanks!
-
Ryan Bigg
science, how's your git now? Please submit a patch if you could.