Skip to content

Commit

Permalink
Add documentation for arel and build_arel
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardelben committed Jul 16, 2012
1 parent 9735076 commit c0e186c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions activerecord/lib/active_record/relation/query_methods.rb
Expand Up @@ -602,10 +602,12 @@ def reverse_order!
self
end

# Returns the Arel object associated with the relation.
def arel
@arel ||= with_default_scope.build_arel
end

# Like #arel, but ignores the default scope of the model.
def build_arel
arel = Arel::SelectManager.new(table.engine, table)

Expand Down

0 comments on commit c0e186c

Please sign in to comment.