diff options
-rw-r--r-- | activerecord/lib/active_record/relation/query_methods.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index f410492b0a..22c605e9d0 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -29,12 +29,12 @@ module ActiveRecord relation end - def select(*args) + def select(value = nil) if block_given? to_a.select {|*block_args| yield(*block_args) } else relation = clone - relation.select_values += args if args.present? + relation.select_values += [value] if value relation end end |