diff options
author | Xavier Noria <fxn@hashref.com> | 2008-05-18 22:02:07 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2008-05-18 22:02:07 +0200 |
commit | bd57507e7fcbe4c388022f4258c3198d1d614f2b (patch) | |
tree | 86044b0c2f16522b28fe7676751eb92f2f6f143a | |
parent | 14bd01b9a9cdd4ec5c9abf8ae595cca880aa6faf (diff) | |
download | rails-bd57507e7fcbe4c388022f4258c3198d1d614f2b.tar.gz rails-bd57507e7fcbe4c388022f4258c3198d1d614f2b.tar.bz2 rails-bd57507e7fcbe4c388022f4258c3198d1d614f2b.zip |
added mention to Model.(first|last|all) in AR's find, and assorted tweaks
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index c78eb1984a..decc6b9b74 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -446,13 +446,17 @@ module ActiveRecord #:nodoc: class << self # Class methods # Find operates with four different retrieval approaches: # - # * Find by id: This can either be a specific id (1), a list of ids (1, 5, 6), or an array of ids ([5, 6, 10]). + # * Find by id - This can either be a specific id (1), a list of ids (1, 5, 6), or an array of ids ([5, 6, 10]). # If no record can be found for all of the listed ids, then RecordNotFound will be raised. - # * Find first: This will return the first record matched by the options used. These options can either be specific - # conditions or merely an order. If no record can be matched, nil is returned. - # * Find last: This will return the last record matched by the options used. These options can either be specific - # conditions or merely an order. If no record can be matched, nil is returned. - # * Find all: This will return all the records matched by the options used. If no records are found, an empty array is returned. + # * Find first - This will return the first record matched by the options used. These options can either be specific + # conditions or merely an order. If no record can be matched, +nil+ is returned. Use + # <tt>Model.find(:first, *args)</tt> or its shortcut <tt>Model.first(*args)</tt>. + # * Find last - This will return the last record matched by the options used. These options can either be specific + # conditions or merely an order. If no record can be matched, nil is returned. Use + # <tt>Model.find(:last, *args)</tt> or its shortcut <tt>Model.last(*args)</tt>. + # * Find all - This will return all the records matched by the options used. + # If no records are found, an empty array is returned. Use + # <tt>Model.find(:all, *args)</tt> or its shortcut <tt>Model.all(*args)</tt>. # # All approaches accept an options hash as their last parameter. The options are: # |