Class: ActsAsOrderedTree::Validators::ScopeValidator

Inherits:
ActiveModel::Validator
  • Object
show all
Defined in:
lib/acts_as_ordered_tree/validators.rb

Instance Method Summary collapse

Instance Method Details

#validate(record) ⇒ Object


10
11
12
# File 'lib/acts_as_ordered_tree/validators.rb', line 10

def validate(record)
  record.errors.add(:parent, :scope) unless record.same_scope?(record.parent)
end