diff options
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-x | activerecord/lib/active_record/base.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 9716473a4e..4f9fd71ffc 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -511,7 +511,19 @@ module ActiveRecord #:nodoc: else find_from_ids(args, options) end end + + # This is an alias for find(:first). You can pass in all the same arguments to this method as you can + # to find(:first) + def first(*args) + find(:first, *args) + end + # This is an alias for find(:last). You can pass in all the same arguments to this method as you can + # to find(:last) + def last(*args) + find(:last, *args) + end + # # Executes a custom sql query against your database and returns all the results. The results will # be returned as an array with columns requested encapsulated as attributes of the model you call |