Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[ci skip] document type_cast_for_write

  • Loading branch information...
commit 43fbdbae17744458d71262836b451d68427bd98d 1 parent e5ac6c8
@schneems schneems authored
View
2  activerecord/lib/active_record/connection_adapters/column.rb
@@ -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?
View
3  activerecord/lib/active_record/connection_adapters/postgresql/column.rb
@@ -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)
Please sign in to comment.
Something went wrong with that request. Please try again.