By far one of the most annoying and unhelpful messages on Rails ever. the “User expected, got User” message tends to pop up now and then when using plugins such as acts_as_commentable or acts_as_taggable, that define models on the vendor/plugins.
The solution, as pointed out by the localhost:3000 blog (nice blog name, I must say ;)), is moving any models that relate to models on your application to your own /models folder. The reason behind the problem is that the libs don’t get reloaded on each server request, whereas the models are (some thoughts on things that reload here). So theoretically, plugins that define models inside them are a bad bad practice.
There’s another less intrusive way to make the plugins workm though: you can add the plugins on the ‘reloadable path’, as explained on spotstory:
Categories
Me
Blogroll
Posted on May 7, 2007 at 7:38 pm
User expected, got User?
One Response to “User expected, got User?”
Leave a Reply
About
… I won’t be laughing at the lies when I’m gone And I can’t question how or when or why when I’m gone Can’t live proud enough to die when I’m gone So I guess I’ll have to do it when I’m here.
Recent Posts
- Very complicated feature…
- Don’t say anything if you’ve got nothing to say…
- del.icio.us is now delicious.com!
- My take on Cuil.com
- Avoiding duplicated posting in Rails
- say ‘there will be cake’
- Are we all becoming stooooopid?
- And here we are again, in 1999
- Web 2.0 users unite
- Globalize versus PDF-Writer, round one!
- Sometimes it’s hard to tell what’s real…
- Breaking news: the new MacBook Pro is afraid of heights!
- I just got pwn3d!
- Rails 1-2-3 (on Leopard)
- JavaME development on OS X: things to remember




















Anthony on June 13th, 2007 at 3:22 pm says:
Thanks so much! This bug was really bothering me.