Disclaimer: This took the work of lots of smart people to track down. I did not discover this on my own and do not deserve the credit for it.
Symptom:
(NoMethodError) "undefined method `fields' for nil:NilClass"
Observed while using rails v3.2.19 - https://github.com/rails/rails/blob/v3.2.19/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
Easy fix: