Permalink
Browse files

[ci skip] document type_cast_for_write

  • Loading branch information...
1 parent e5ac6c8 commit 43fbdbae17744458d71262836b451d68427bd98d @schneems schneems committed May 7, 2014
@@ -72,6 +72,8 @@ def binary?
end
# Casts a Ruby value to something appropriate for writing to the database.
+ # Numeric columns will typecast boolean and string to appropriate numeric
+ # values.
def type_cast_for_write(value)
return value unless number?
@@ -98,6 +98,9 @@ def self.extract_value_from_default(default)
end
end
+ # Casts a Ruby value to something appropriate for writing to Postgresql.
+ # see ActiveRecord::ConnectionAdapters::Class#type_cast_for_write
+ # see ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID::Type
def type_cast_for_write(value)
if @oid_type.respond_to?(:type_cast_for_write)
@oid_type.type_cast_for_write(value)

0 comments on commit 43fbdba

Please sign in to comment.