Skip to content

Commit

Permalink
remove unnecessary condition in the reify_belongs_tos method
Browse files Browse the repository at this point in the history
  • Loading branch information
theRealNG committed Mar 14, 2016
1 parent 11c23f0 commit e12b9aa
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/paper_trail/reifier.rb
Expand Up @@ -123,7 +123,7 @@ def prepare_array_for_has_many(array, options, versions)
nil
end

def reify_associations model, options, version
def reify_associations(model, options, version)
reify_has_ones version.transaction_id, model, options if options[:has_one]

reify_belongs_tos version.transaction_id, model, options if options[:belongs_to]
Expand Down Expand Up @@ -182,8 +182,6 @@ def reify_belongs_tos(transaction_id, model, options = {})

collection = if version.nil?
assoc.klass.where(assoc.klass.primary_key => collection_key).first
elsif version.event == "create"
options[:mark_for_destruction] ? collection.mark_for_destruction : nil
else
version.reify(options.merge(has_many: false, has_one: false,
belongs_to: false))
Expand Down

0 comments on commit e12b9aa

Please sign in to comment.