mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
use parenthesis so limit works on all dbs
This commit is contained in:
parent
cb1f8413de
commit
d3b2596884
1 changed files with 4 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue