开发者

Rails 3 ActiveRecord chaining

开发者 https://www.devze.com 2023-02-17 14:15 出处:网络
I\'m new to Rails and I\'m not sure why my chaining isn\'t working. Working my_model.select(\'name\').where(\'status_id = 6\').all

I'm new to Rails and I'm not sure why my chaining isn't working.

Working

my_model.select('name').where('status_id = 6').all

Not Working

my_model.select('name').where('status_id = 6').order('name')

Why does chaining the order after the where not execute the query? I've tried a开发者_StackOverflowdding the .all after the .order but that didn't seem to work either.


Looks like this is a known bug in the jdbc adapter: http://kenai.com/jira/browse/ACTIVERECORD_JDBC-154

If you make these changes it will fix it: https://github.com/ystael/activerecord-jdbc-adapter/commit/8815d2fe133afb6774ebe12cc27c3a977dbf7ad2

0

精彩评论

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