Skip to content

Instantly share code, notes, and snippets.

@nateberkopec
Created November 1, 2013 17:12
Show Gist options
  • Save nateberkopec/7268619 to your computer and use it in GitHub Desktop.
Save nateberkopec/7268619 to your computer and use it in GitHub Desktop.
class Subscription
belongs_to :gifter, :class_name => 'User', :foreign_key => :gifter_id
end
@user = User.first
Subscription.where(gifter: @user)
# ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR: column subscriptions.gifter does not exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment