开发者

find_by_ dynamic finder stopped to work

I have a really strange behaviour. My Rails 3 models do not provide me with the dynamic finder methods anymore. If I call a method, e.g. Person.find_by_lastname("Smith")开发者_运维百科 I get a nil object back. When I try to autocomplete-tab the model's find_by methods, I only get 'find', 'find_by_sql', 'find_each' and 'find_in_batches'.

Another strange thing is, that if I call any method on a model, I get nil back, even if the method does not exist in the model. Models can be saved and taken from the database as usual.

It would be great if someone could point me in the right direction.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜