diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2010-04-02 17:58:13 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-04-02 18:57:46 +0100 |
commit | 62fe16932c9b7c3044017900114193e06814fd0c (patch) | |
tree | 97df93c52da5573aff7509fae5557d3c955d7a0d /activerecord/lib/active_record/named_scope.rb | |
parent | ee07950c03bf8aab703191d73165eb206f9f55ef (diff) | |
download | rails-62fe16932c9b7c3044017900114193e06814fd0c.tar.gz rails-62fe16932c9b7c3044017900114193e06814fd0c.tar.bz2 rails-62fe16932c9b7c3044017900114193e06814fd0c.zip |
Make Relation#first and Relation#last behave like named scope's
Diffstat (limited to 'activerecord/lib/active_record/named_scope.rb')
-rw-r--r-- | activerecord/lib/active_record/named_scope.rb | 16 |
1 files changed, 0 insertions, 16 deletions
diff --git a/activerecord/lib/active_record/named_scope.rb b/activerecord/lib/active_record/named_scope.rb index 3efcff11ca..be26b1f47f 100644 --- a/activerecord/lib/active_record/named_scope.rb +++ b/activerecord/lib/active_record/named_scope.rb @@ -142,22 +142,6 @@ module ActiveRecord relation.merge(scope) end - def first(*args) - if args.first.kind_of?(Integer) || (loaded? && !args.first.kind_of?(Hash)) - to_a.first(*args) - else - args.first.present? ? apply_finder_options(args.first).first : super - end - end - - def last(*args) - if args.first.kind_of?(Integer) || (loaded? && !args.first.kind_of?(Hash)) - to_a.last(*args) - else - args.first.present? ? apply_finder_options(args.first).last : super - end - end - def ==(other) case other when Scope |