diff options
Diffstat (limited to 'activeresource/lib/active_resource/base.rb')
-rw-r--r-- | activeresource/lib/active_resource/base.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb index f27febb7ef..e5b8589fb3 100644 --- a/activeresource/lib/active_resource/base.rb +++ b/activeresource/lib/active_resource/base.rb @@ -611,6 +611,28 @@ module ActiveResource end end + + # A convenience wrapper for <tt>find(:first, *args)</tt>. You can pass + # in all the same arguments to this method as you can to + # <tt>find(:first)</tt>. + def first(*args) + find(:first, *args) + end + + # A convenience wrapper for <tt>find(:last, *args)</tt>. You can pass + # in all the same arguments to this method as you can to + # <tt>find(:last)</tt>. + def last(*args) + find(:last, *args) + end + + # This is an alias for find(:all). You can pass in all the same + # arguments to this method as you can to <tt>find(:all)</tt> + def all(*args) + find(:all, *args) + end + + # Deletes the resources with the ID in the +id+ parameter. # # ==== Options |