Skip to content

Instantly share code, notes, and snippets.

@bradyswenson
Created March 16, 2015 19:21
Show Gist options
  • Save bradyswenson/3842a3ae5bd11e5ab7d8 to your computer and use it in GitHub Desktop.
Save bradyswenson/3842a3ae5bd11e5ab7d8 to your computer and use it in GitHub Desktop.
@posts = Category.where(id: 1).posts
irb(main):044:0> @posts = Category.where(id: 1).posts
NoMethodError: Category Load (0.1ms) SELECT "categories".* FROM "categories" WHERE "categories"."id" = 1
undefined method `posts' for #<ActiveRecord::Relation::ActiveRecord_Relation_Category:0x000001046fe4d8>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment