Posted on May 7, 2007 at 7:38 pm

User expected, got User?

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:

Tags:, ,

One Response to “User expected, got User?”

  1. Anthony on June 13th, 2007 at 3:22 pm says:

    Thanks so much! This bug was really bothering me.

Leave a Reply