diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2011-07-09 05:20:42 -0700 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2011-07-09 05:20:42 -0700 |
commit | bc364afb9333cb7729452adf09fc70ccac510226 (patch) | |
tree | ed5e8450873ef013e3f84797bd74857952b624b1 /activerecord/lib | |
parent | 111968d4024fdccc386979551cdfc7799b39cff0 (diff) | |
parent | 7c921fbf1572698dd9541426b05b70d1c951cbe5 (diff) | |
download | rails-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')
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 6 |
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 |