1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

15 commits

Author SHA1 Message Date
Jon Leighton
55b24888bb Remove ActiveRecord::Base.to_a
On reflection, it seems like a bit of a weird method to have on
ActiveRecord::Base, and it shouldn't be needed most of the time anyway.
2012-08-03 11:51:52 +01:00
Xavier Noria
077372b20d load active_support/deprecation in active_support/rails 2012-08-02 21:59:23 +02:00
Xavier Noria
4aee8dd486 load active_support/core_ext/module/delegation in active_support/rails 2012-08-02 21:59:23 +02:00
Jon Leighton
6a81ccd69d ActiveRecord::Base.all returns a Relation.
Previously it returned an Array.

If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This
is more explicit.

In most cases this should not break existing code, since
Relations use method_missing to delegate unknown methods to #to_a
anyway.
2012-07-27 13:34:12 +01:00
kennyj
1b25283943 Log query plan when we use count_by_sql method. 2012-07-18 03:02:11 +09:00
Marcelo Silveira
1379375f93 Introducing take as a replacement to the old behavior of first 2012-05-02 21:25:40 -03:00
Andrew White
838101ae04 Fix PR #6091
1. ActiveRecord::Base is not ActiveRecord::Relation
2. The order of records from an SQL query is uncertain without an ORDER clause
3. Run your own tests when submitting a pull request
2012-04-30 22:18:35 +01:00
Jon Leighton
13b3c77e39 Add Relation#find_by and Relation#find_by! 2012-03-30 12:52:29 +01:00
Aaron Patterson
9bcb9cd55f column types are passed from the result set to the instantiated AR object 2012-02-07 13:51:52 -08:00
Jon Leighton
75de1ce131 Merge pull request #4805 from xuanxu/none_and_null_object_pattern
Added `none` query method to return zero records.
2012-01-31 11:17:02 -08:00
Aaron Patterson
c091ab0207 always return the result set from select_all 2012-01-31 10:58:16 -08:00
Aaron Patterson
40ce682048 made the result set object act more like an array 2012-01-31 10:58:16 -08:00
Juanjo Bazán
8270e4a8ce Added none query method to return zero records.
And added NullRelation class implementing the null object pattern for the `Relation` class.
2012-01-31 19:50:09 +01:00
Jon Leighton
4c4760a619 Add ActiveRecord::Relation#references (#950) 2012-01-16 21:17:17 +00:00
Jon Leighton
ceb33f8493 Split out most of the AR::Base code into separate modules 🍰 2011-12-15 20:45:37 +00:00