Skip to content

Instantly share code, notes, and snippets.

@ybart
Created June 15, 2011 14:03
Show Gist options
  • Save ybart/1027169 to your computer and use it in GitHub Desktop.
Save ybart/1027169 to your computer and use it in GitHub Desktop.
class Profile < ActiveRecord::Base
  belongs_to :license
  
  has_many :offers, :through => :application
  has_one :application, :through => :license  
end

I ran Profile.first.offers

and got

 PGError: ERROR:  column applications.profile_id does not exist
LINE 1: ...ffers".application_id = "applications".id WHERE (("applicati...
                                                             ^
: SELECT "offers".* FROM "offers" INNER JOIN "applications" ON "offers".application_id = "applications".id WHERE (("applications".profile_id = 1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment