aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2011-07-09 05:20:42 -0700
committerSantiago Pastorino <santiago@wyeworks.com>2011-07-09 05:20:42 -0700
commitbc364afb9333cb7729452adf09fc70ccac510226 (patch)
treeed5e8450873ef013e3f84797bd74857952b624b1 /activerecord/lib/active_record
parent111968d4024fdccc386979551cdfc7799b39cff0 (diff)
parent7c921fbf1572698dd9541426b05b70d1c951cbe5 (diff)
downloadrails-bc364afb9333cb7729452adf09fc70ccac510226.tar.gz
rails-bc364afb9333cb7729452adf09fc70ccac510226.tar.bz2
rails-bc364afb9333cb7729452adf09fc70ccac510226.zip
Merge pull request #2007 from amatsuda/having_vargs_nomethoderror_fix
having() raises NoMethodError: undefined method `empty?' when the given argument does not respond to empty?
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r--activerecord/lib/active_record/relation/query_methods.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb
index d17861f407..8bd4732c0c 100644
--- a/activerecord/lib/active_record/relation/query_methods.rb
+++ b/activerecord/lib/active_record/relation/query_methods.rb
@@ -96,11 +96,11 @@ module ActiveRecord
relation
end
- def having(*args)
- return self if args.blank?
+ def having(opts, *rest)
+ return self if opts.blank?
relation = clone
- relation.having_values += build_where(*args)
+ relation.having_values += build_where(opts, rest)
relation
end