Problem Using ActiveRecord #exists? In Eager Load Resultset
So few weeks ago i’ve got problem in a rails apps. New Relic reports about 500 error, where the main cause is accessing method in nil object. Here is code snippet, causing the error :
[code language=”ruby”]class User < ActiveRecord::Base has_many :posts, -> { order “created_at DESC”