提交 27bdeeb5 编写于 作者: J Justin Collins

Fix scope() tests: :condition -> :conditions

上级 d0fbd791
......@@ -5,9 +5,9 @@ class User < ActiveRecord::Base
scope :blah, where("thinger = '#{BLAH}'")
scope :dah, lambda {|*args| { :condition => "dah = '#{args[1]}'"}}
scope :dah, lambda {|*args| { :conditions => "dah = '#{args[1]}'"}}
scope :phooey, :condition => "phoeey = '#{User.phooey}'"
scope :phooey, :conditions => "phoeey = '#{User.phooey}'"
scope :this_is_safe, lambda { |name|
where("name = ?", "%#{name.downcase}%")
......@@ -15,5 +15,5 @@ class User < ActiveRecord::Base
scope :this_is_also_safe, where("name = ?", "%#{name.downcase}%")
scope :should_not_warn, :condition => ["name = ?", "%#{name.downcase}%"]
scope :should_not_warn, :conditions => ["name = ?", "%#{name.downcase}%"]
end
......@@ -75,7 +75,7 @@ class Rails31Tests < Test::Unit::TestCase
assert_warning :type => :warning,
:warning_type => "SQL Injection",
:line => 10,
:message => /^Possible SQL injection near line 10: scope\(:phooey, :condition =>/,
:message => /^Possible SQL injection near line 10: scope\(:phooey, :conditions =>/,
:confidence => 0,
:file => /user\.rb/
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册