Skip to content

Commit

Permalink
[core] add more examples to Relation#combine docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotr Solnica committed Oct 22, 2017
1 parent 579485e commit 1ebf138
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions core/lib/rom/relation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -225,15 +225,27 @@ def each
end
end

# Combine with other relations
# Combine with other relations using configured associations
#
# @overload combine(*associations)
# Composes relations using configured associations
#
# @example
# users.combine(:tasks, :posts)
#
# @param *associations [Array<Symbol>] A list of association names
#
# @overload combine(*associations, **nested_associations)
# @example
# users.combine(:tasks, posts: :authors)
#
# @param *associations [Array<Symbol>] A list of association names
# @param *nested_associations [Hash] A hash with nested association names
#
# @overload combine(associations)
# @example
# users.combine(posts: [:authors, reviews: [:tags, comments: :author])
#
# @param *associations [Hash] A hash with nested association names
#
# @return [Relation]
#
# @api public
Expand Down

0 comments on commit 1ebf138

Please sign in to comment.