diff options
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb index 5b150f2731..d61ca17391 100644 --- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb @@ -39,6 +39,12 @@ module ActiveRecord super(name, self.class.extract_value_from_default(default), sql_type, null) end + def type_cast(value) + return super unless sql_type == 'bytea' + + PGconn.unescape_bytea(value) if value + end + # :stopdoc: class << self attr_accessor :money_precision |