Created
January 15, 2015 17:48
-
-
Save bgvo/443a2ce15dc34b8f6f50 to your computer and use it in GitHub Desktop.
has_many association not working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User | |
include Mongoid::Document | |
has_many :wishlists, class_name: "Item" | |
end | |
In rails s: | |
>> u = User.first | |
>> u.wishlists.push(Item.first) | |
>> TypeError: nil is not a symbol |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment