raw1z / amistad

Adds friendships management into a rails application
http://github.com/raw1z/amistad
MIT License
185 stars 71 forks source link

Mysql2::Error: Unknown column 'friendships.friendable_id' #34

Closed jdinse closed 11 years ago

jdinse commented 11 years ago

After upgrading from 0.7.5 to 0.9.2 I got this error when calling the friends-method on a user, e.g.

user.friends

ActiveRecord::StatementInvalid: Mysql2::Error: Unknown column 'friendships.friendable_id' in 'where clause': SELECT users.* FROM users WHERE ((users.id IN (SELECT friendships.friend_id FROM friendships WHERE ((friendships.friendable_id = 13 AND friendships.pending = 0 AND friendships.blocker_id IS NULL))) OR users.id IN (SELECT friendships.friendable_id FROM friendships WHERE ((friendships.friend_id = 13 AND friendships.pending = 0 AND friendships.blocker_id IS NULL)))))

raw1z commented 11 years ago

Maybe you didn't run the migrations.