Reifier: Inline a private method, for now

- For me, it does not improve readability, but
- If this comparison becomes common in the future, we can have a private
method like this to reduce duplication.
This commit is contained in:
Jared Beck 2020-05-03 00:37:47 -04:00
parent a2bf2ffc9c
commit 16cf5e5d30
1 changed files with 1 additions and 5 deletions

View File

@ -57,7 +57,7 @@ module PaperTrail
# The `dup` option and destroyed version always returns a new object,
# otherwise we should attempt to load item or to look for the item
# outside of default scope(s).
model = if options[:dup] == true || destroy_event?(version)
model = if options[:dup] == true || version.event == "destroy"
klass.new
else
find_cond = { klass.primary_key => version.item_id }
@ -125,10 +125,6 @@ module PaperTrail
class_name = inher_col_value.blank? ? version.item_type : inher_col_value
class_name.constantize
end
def destroy_event?(version)
version.event == "destroy"
end
end
end
end