Skip to content

Commit

Permalink
Update the documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Startouf committed Jun 8, 2019
1 parent fa65a06 commit 6a93b6e
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions lib/mongoid/history/attributes/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ class Update < ::Mongoid::History::Attributes::Base
#
# {
# 'foo' => ['foo_before_changes', 'foo_after_changes']
# 'nested_bar' => {
# 'baz' => ['nested_bar_baz_before_changes', 'nested_bar_baz_after_changes']
# 'nested_bar.baz' => ['nested_bar_baz_before_changes', 'nested_bar_baz_after_changes']
# }
# }
#
# @return [Hash<String, ?>] Hash of changes
# ? can be either a pair or a hash for embedded documents
# @return [Hash<String, Array<(?,?)>>] Hash of changes
def attributes
changes_from_parent.deep_merge(changes_from_children)
end
Expand Down Expand Up @@ -44,7 +42,7 @@ def changes_from_children
#
# {"child"=>{"name"=>["todd", "mario"]}}
#
# @return [Hash<String, Array<?,?>] changes of embeds_ones from embedded documents
# @return [Hash<String, Array<(?,?)>] changes of embeds_ones from embedded documents
def embeds_one_changes_from_embedded_documents
embedded_doc_changes = {}
trackable_class.tracked_embeds_one.each do |rel|
Expand All @@ -61,8 +59,8 @@ def embeds_one_changes_from_embedded_documents
embedded_doc_changes
end

# @param [String] relation <description>
# @param [String] value <description>
# @param [String] relation
# @param [String] value
#
# @return [Hash<String, Array<(?,?)>>]
def embeds_one_changes_from_parent(relation, value)
Expand All @@ -76,8 +74,8 @@ def embeds_one_changes_from_parent(relation, value)
{ relation => [original_value, modified_value] }
end

# @param [String] relation <description>
# @param [String] value <description>
# @param [String] relation
# @param [String] value
#
# @return [Hash<Array<(?,?)>>]
def embeds_many_changes_from_parent(relation, value)
Expand Down

0 comments on commit 6a93b6e

Please sign in to comment.