diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2012-12-04 22:26:16 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2012-12-04 22:26:16 +0530 |
commit | 40e16121c05f10f9b75b6cd68c32092876142861 (patch) | |
tree | ef029336773e706cad2442d232a184ff0db38efe /activerecord/lib/active_record/querying.rb | |
parent | 9d3ce6c7d24fb8fe63f4bde4718e6af6225e5a98 (diff) | |
parent | 2b847a0a9b56c7ede40012c7b3bd8ec90d6c111c (diff) | |
download | rails-40e16121c05f10f9b75b6cd68c32092876142861.tar.gz rails-40e16121c05f10f9b75b6cd68c32092876142861.tar.bz2 rails-40e16121c05f10f9b75b6cd68c32092876142861.zip |
Merge branch 'master' of github.com:lifo/docrails
Conflicts:
guides/source/migrations.md
Diffstat (limited to 'activerecord/lib/active_record/querying.rb')
-rw-r--r-- | activerecord/lib/active_record/querying.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/activerecord/lib/active_record/querying.rb b/activerecord/lib/active_record/querying.rb index 45f6a78428..5ddcaee6be 100644 --- a/activerecord/lib/active_record/querying.rb +++ b/activerecord/lib/active_record/querying.rb @@ -26,14 +26,13 @@ module ActiveRecord # MySQL specific terms will lock you to using that particular database engine or require you to # change your call if you switch engines. # - # ==== Examples # # A simple SQL query spanning multiple tables # Post.find_by_sql "SELECT p.title, c.author FROM posts p, comments c WHERE p.id = c.post_id" - # > [#<Post:0x36bff9c @attributes={"title"=>"Ruby Meetup", "first_name"=>"Quentin"}>, ...] + # # => [#<Post:0x36bff9c @attributes={"title"=>"Ruby Meetup", "first_name"=>"Quentin"}>, ...] # # # 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={"title"=>"The Cheap Man Buys Twice"}>, ...] + # # => [#<Post:0x36bff9c @attributes={"title"=>"The Cheap Man Buys Twice"}>, ...] def find_by_sql(sql, binds = []) logging_query_plan do result_set = connection.select_all(sanitize_sql(sql), "#{name} Load", binds) @@ -57,8 +56,6 @@ module ActiveRecord # # * +sql+ - An SQL statement which should return a count query from the database, see the example below. # - # ==== Examples - # # Product.count_by_sql "SELECT COUNT(*) FROM sales s, customers c WHERE s.customer_id = c.id" def count_by_sql(sql) logging_query_plan do |