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:
parent
a2bf2ffc9c
commit
16cf5e5d30
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue