Fix Lint/NestedMethodDefinition rubocop issue and remove it from rubocop_todo list

This commit is contained in:
Bertocq
2017-06-16 00:24:07 +02:00
parent 6e1fa53e2c
commit db97314f7b
2 changed files with 25 additions and 28 deletions

View File

@@ -2,36 +2,38 @@ module ActsAsParanoidAliases
def self.included(base)
base.extend(ClassMethods)
self.class_eval do
def hide
return false if hidden?
update_attribute(:hidden_at, Time.current)
after_hide
end
def hide
return false if hidden?
update_attribute(:hidden_at, Time.current)
after_hide
end
def hidden?
deleted?
end
def hidden?
deleted?
end
def after_hide
end
def after_hide
end
def confirmed_hide?
confirmed_hide_at.present?
end
def confirmed_hide?
confirmed_hide_at.present?
end
def confirm_hide
update_attribute(:confirmed_hide_at, Time.current)
end
def confirm_hide
update_attribute(:confirmed_hide_at, Time.current)
end
def restore(opts={})
return false unless hidden?
super(opts)
update_attribute(:confirmed_hide_at, nil)
after_restore
end
def restore(opts={})
return false unless hidden?
super(opts)
update_attribute(:confirmed_hide_at, nil)
after_restore
end
def after_restore
def after_restore
end
end
end