轨道3 ActiveRecord的链接 [英] Rails 3 ActiveRecord chaining

查看:114
本文介绍了轨道3 ActiveRecord的链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆