mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Make Model.all just a wrapper for find(:all)
This commit is contained in:
parent
d6d0fe8c8f
commit
8957f5db5d
1 changed files with 3 additions and 9 deletions
|
@ -669,16 +669,10 @@ module ActiveRecord #:nodoc:
|
||||||
find(:last, *args)
|
find(:last, *args)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns an ActiveRecord::Relation object. You can pass in all the same arguments to this method as you can
|
# A convenience wrapper for <tt>find(:all, *args)</tt>. You can pass in all the
|
||||||
# to find(:all).
|
# same arguments to this method as you can to <tt>find(:all)</tt>.
|
||||||
def all(*args)
|
def all(*args)
|
||||||
options = args.extract_options!
|
find(:all, *args)
|
||||||
|
|
||||||
if options.empty? && !scoped?(:find)
|
|
||||||
arel_table.to_a
|
|
||||||
else
|
|
||||||
construct_finder_arel_with_includes(options).to_a
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Executes a custom SQL query against your database and returns all the results. The results will
|
# Executes a custom SQL query against your database and returns all the results. The results will
|
||||||
|
|
Loading…
Reference in a new issue