lib/activerecord-postgres-composite-types/active_record_3_2.rb
def type_cast_with_composite_types(value, column)
        case value
          when PostgresCompositeType
            PostgreSQLColumn.composite_type_to_string(value, self)
          when Array, Hash
            if (klass = column.composite_type_class)
              value = klass.new(value)
              PostgreSQLColumn.composite_type_to_string(value, self)
            else
              type_cast_without_composite_types(value, column)
            end
	        else
            type_cast_without_composite_types(value, column)
        end
      end
# Cast a +value+ to a type that the database understands.
Cast a +value+ to a type that the database understands.
Cast a + value + to a type that the database understands .
def type_cast_with_composite_types(value, column)
        case value
          when PostgresCompositeType
            PostgreSQLColumn.composite_type_to_string(value, self)
          when Array, Hash
            if (klass = column.composite_type_class)
              value = klass.new(value)
              PostgreSQLColumn.composite_type_to_string(value, self)
            else
              type_cast_without_composite_types(value, column)
            end
	        else
            type_cast_without_composite_types(value, column)
        end
      end
def type_cast_with_composite_types ( value , column ) case value when PostgresCompositeType PostgreSQLColumn . composite_type_to_string ( value , self ) when Array , Hash if ( klass = column . composite_type_class ) value = klass . new ( value ) PostgreSQLColumn . composite_type_to_string ( value , self ) else type_cast_without_composite_types ( value , column ) end else type_cast_without_composite_types ( value , column ) end end
Cast a +value+ to a type that the database understands.
Cast a + value + to a type that the database understands .
value
column