aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib')
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb6
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