diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-09 11:50:53 -0800 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-02-09 11:51:09 -0800 |
commit | d3b2596884d884b72d50de2b7ced6097df670736 (patch) | |
tree | 37821d3b31e5adfd78766fa9c5ef57c59fbd2edb | |
parent | cb1f8413def871e7fd42064e5144dfeb8460c1fc (diff) | |
download | rails-d3b2596884d884b72d50de2b7ced6097df670736.tar.gz rails-d3b2596884d884b72d50de2b7ced6097df670736.tar.bz2 rails-d3b2596884d884b72d50de2b7ced6097df670736.zip |
use parenthesis so limit works on all dbs
-rw-r--r-- | activerecord/test/cases/base_test.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb index 5b162f4f6f..ef6b741acd 100644 --- a/activerecord/test/cases/base_test.rb +++ b/activerecord/test/cases/base_test.rb @@ -94,13 +94,11 @@ class BasicsTest < ActiveRecord::TestCase Topic.limit("1, 7 procedure help()").all end end - - unless current_adapter?(:MysqlAdapter) - def test_limit_should_allow_sql_literal - assert_equal 1, Topic.limit(Arel.sql('2-1')).all.length - end + + def test_limit_should_allow_sql_literal + assert_equal 1, Topic.limit(Arel.sql('(2 - 1)')).all.length end - + def test_select_symbol topic_ids = Topic.select(:id).map(&:id).sort assert_equal Topic.find(:all).map(&:id).sort, topic_ids |