module HideAncestry::Validators

Private Instance Methods

already_restored() click to toggle source
# File lib/hide_ancestry/validators.rb, line 12
def already_restored
  errors.add :base, 'Already restored'
end
can_not_has_parent_or_children() click to toggle source
# File lib/hide_ancestry/validators.rb, line 5
def can_not_has_parent_or_children
  errors.add(
    :base,
    "hidden node can`t has any real parent or children"
    ) if self.ancestry.present?
end
not_valid() click to toggle source
# File lib/hide_ancestry/validators.rb, line 16
def not_valid
  errors.add :base, "#{self.class} is not valid"
end