assert_equalfalse,Topic.exists?(("9"*53).to_i)# number that's bigger than int
flunkifdefined?ActiveRecord::ConnectionAdapters::PostgreSQLAdapterandTopic.connection.is_a?ActiveRecord::ConnectionAdapters::PostgreSQLAdapter# PostgreSQL does raise here
rescueActiveRecord::StatementInvalid
# PostgreSQL complains that it can't coerce a numeric that's bigger than int into int
rescueException
flunk
end
begin
assert_equalfalse,Topic.exists?("foo")
flunkifdefined?ActiveRecord::ConnectionAdapters::PostgreSQLAdapterandTopic.connection.is_a?ActiveRecord::ConnectionAdapters::PostgreSQLAdapter# PostgreSQL does raise here
rescueActiveRecord::StatementInvalid
# PostgreSQL complains about string comparison with integer field