adding a test for #10830

Conflicts:
	activerecord/test/cases/adapters/postgresql/bytea_test.rb
the typecast value should be passed to the serializer.  fixes #10830