轨道3 ActiveRecord的链接 [英] Rails 3 ActiveRecord chaining
问题描述
我是新来的Rails,我不知道为什么我的链接无法正常工作。
I'm new to Rails and I'm not sure why my chaining isn't working.
工作
my_model.select('name').where('status_id = 6').all
不工作
my_model.select('name').where('status_id = 6').order('name')
为什么链接的序
在其中,
不执行查询?我试着加入。所有
在 .order
但是这似乎并没有擦出火花。
Why does chaining the order
after the where
not execute the query? I've tried adding the .all
after the .order
but that didn't seem to work either.
推荐答案
看起来这是在JDBC适配器一个已知的错误:的 http://kenai.com/jira/browse/ACTIVERECORD_JDBC-154
Looks like this is a known bug in the jdbc adapter: http://kenai.com/jira/browse/ACTIVERECORD_JDBC-154
如果你做这些改变会解决它:<一href="https://github.com/ystael/activerecord-jdbc-adapter/commit/8815d2fe133afb6774ebe12cc27c3a977dbf7ad2" rel="nofollow">https://github.com/ystael/activerecord-jdbc-adapter/commit/8815d2fe133afb6774ebe12cc27c3a977dbf7ad2
If you make these changes it will fix it: https://github.com/ystael/activerecord-jdbc-adapter/commit/8815d2fe133afb6774ebe12cc27c3a977dbf7ad2
这篇关于轨道3 ActiveRecord的链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!