提交 80b5331c 编写于 作者: J Jeremy Kemper

Rollback [4584], bad test. Reopens #3819.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4586 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 1060fe2d
......@@ -2,8 +2,6 @@
* Update callbacks documentation. #3970 [Robby Russell <robby@planetargon.com>]
* Don't modify options parameters in-place. #3819 [mpalmer@hezmatt.org]
* PostgreSQL: correctly quote the ' in pk_and_sequence_for. #5462 [tietew@tietew.net]
* PostgreSQL: correctly quote microseconds in timestamps. #5641 [rick@rickbradley.com]
......
......@@ -1390,7 +1390,7 @@ def raise_if_bind_arity_mismatch(statement, expected, provided) #:nodoc:
end
def extract_options_from_args!(args) #:nodoc:
args.last.is_a?(Hash) ? args.pop.dup : {}
args.last.is_a?(Hash) ? args.pop : {}
end
VALID_FIND_OPTIONS = [ :conditions, :include, :joins, :limit, :offset,
......
......@@ -5,10 +5,9 @@
require 'fixtures/entrant'
require 'fixtures/developer'
require 'fixtures/post'
require 'fixtures/author'
class FinderTest < Test::Unit::TestCase
fixtures :authors, :companies, :topics, :entrants, :developers, :developers_projects, :posts, :accounts
fixtures :companies, :topics, :entrants, :developers, :developers_projects, :posts, :accounts
def test_find
assert_equal(topics(:first).title, Topic.find(1).title)
......@@ -450,18 +449,6 @@ def test_select_values
assert_equal ["37signals","Summit","Microsoft", "Flamboyant Software", "Ex Nihilo", "RailsCore", "Leetsoft", "Jadedpixel"], Company.connection.select_values("SELECT name FROM companies ORDER BY id")
end
def test_find_doesnt_mangle_parameters
author = Author.find(1)
args = [:all, {:conditions => "body like '%t%'"}]
author.posts.each do |p|
assert_equal Post.find(p.id).comments.length,
p.comments.find(*args).length,
"Post ##{p.id} doesn't find correct number of comments"
end
end
protected
def bind(statement, *vars)
if vars.first.is_a?(Hash)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册