aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2010-10-12 15:57:26 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2010-10-26 13:44:07 -0700
commitcc468d3ec81d6f1298fca91c0549584b36dafcc6 (patch)
tree02c6e8949a86127d7ad9c08aef18be9c7a966063 /activerecord/lib/active_record/base.rb
parent6ceffb8178b6d419d4453e1e24d4138215c35217 (diff)
downloadrails-cc468d3ec81d6f1298fca91c0549584b36dafcc6.tar.gz
rails-cc468d3ec81d6f1298fca91c0549584b36dafcc6.tar.bz2
rails-cc468d3ec81d6f1298fca91c0549584b36dafcc6.zip
exec returns an AR::Result
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rw-r--r--activerecord/lib/active_record/base.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 053b796991..db7f9b7974 100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -448,8 +448,8 @@ module ActiveRecord #:nodoc:
# # You can use the same string replacement techniques as you can with ActiveRecord#find
# Post.find_by_sql ["SELECT title FROM posts WHERE author = ? AND created > ?", author_id, start_date]
# > [#<Post:0x36bff9c @attributes={"first_name"=>"The Cheap Man Buys Twice"}>, ...]
- def find_by_sql(sql)
- connection.select_all(sanitize_sql(sql), "#{name} Load").collect! { |record| instantiate(record) }
+ def find_by_sql(sql, bind_values = [])
+ connection.select_all(sanitize_sql(sql), "#{name} Load", bind_values).collect! { |record| instantiate(record) }
end
# Creates an object (or multiple objects) and saves it to the database, if validations pass.