Class: ActsAsOrderedTree::Validators::ScopeValidator
- Inherits:
-
ActiveModel::Validator
- Object
- ActiveModel::Validator
- ActsAsOrderedTree::Validators::ScopeValidator
- 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 |