开发者

rails 3 model name conflict

i开发者_JAVA技巧 have a model called Job. In ruby core there is a module Benchmark and class within it Job.

That's make the conflict when i try to call Job.all.

Is there any possible and safe solution to resolve this without to rename my model?

Big thanks


Renaming your model is the safest way, but you can try with namespaces:

module MyModule
   class Job < ActiveRecord::Base
   end
end
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜