1
我有一个模块内的滑轨类Rails的ActiveRecord的查询未能找到记录类模块
module Test
class A < ActiveRecord::Base
end
end
林面临着查询模型的某些问题
下面的查询工作得很好,符合该到数据库的连接模型是完美
Test::A.all.size
Test::A.first
Test::A.find(1)
但是当我做了的ActiveRecord找到我得到一个错误
Test::A.find(:first, :conditions => {:id => 1})
ActiveRecord::RecordNotFound: Couldn't find all Test::As with 'id': (first, {:conditions=>{:id=>1}}) (found 0 results, but was looking for 2)
什么似乎是问题?这是查询模块内部类的错误方法吗?
你的Rails版本是什么? –
Rails版本是4.2 – DanMatlin