I'm getting the following error message whenever an error is raised by the adapter:
NoMethodError: undefined method `error_field' for #<PGresult:0x007fbd7589fed8>
from /Users/thunt/Work/redeemable/promofly/.bundle/gems/activesupport-3.2.8/lib/active_support/core_ext/object/try.rb:36:in `try'
from /Users/thunt/Work/redeemable/promofly/.bundle/gems/pg_power-1.1.0/lib/pg_power/connection_adapters/postgresql_adapter/translate_exception.rb:9:in `translate_exception'
from /Users/thunt/Work/redeemable/promofly/.bundle/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:1150:in `translate_exception'
This should be raising an error like this instead:
ActiveRecord::StatementInvalid: PGError: ERROR: invalid input syntax for integer: "missing"
But pg_power is breaking this somehow.
Here are the relevant Gem versions:
Thanks for the report.
Unfortunately I'm not able to reproduce the error(ruby1.9.3, ruby1.8.7):
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT 1 [["id", :missing]]
PG::Error: ERROR: invalid input syntax for integer: "missing"
@tylerhunt can you provide more information about environment(ruby version and OS) and steps to reproduce?
I did some more testing on a fresh app and discovered that the pg version reported above was incorrect. The Gemfile.lock had actually frozen it at 0.11.0. Updating to the 0.14 series seems to resolve the issue. Sorry for the confusion and the wasted cycles.