aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/lib/active_record/base.rb')
-rwxr-xr-xactiverecord/lib/active_record/base.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 7a34e345a2..9a3a02870a 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -663,7 +663,11 @@ module ActiveRecord #:nodoc:
# This is an alias for find(:all). You can pass in all the same arguments to this method as you can
# to find(:all)
def all(*args)
- construct_finder_arel(*args)
+ if args.empty? && !scoped?(:find)
+ arel_table
+ else
+ construct_finder_arel(*args)
+ end
end
# Executes a custom SQL query against your database and returns all the results. The results will
@@ -2992,7 +2996,7 @@ module ActiveRecord #:nodoc:
end
def arel_table(reload = nil)
- @arel_table = Relation.new(self, self.class.table_name) if reload || @arel_table.nil?
+ @arel_table = Relation.new(self.class, self.class.table_name) if reload || @arel_table.nil?
@arel_table
end