We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 8cb0cbe + 47d762d commit 73e9064Copy full SHA for 73e9064
lib/ancestry/instance_methods.rb
@@ -4,7 +4,7 @@ module Ancestry
4
module InstanceMethods
5
# Validate that the ancestors don't include itself
6
def ancestry_exclude_self
7
- errors.add(:base, I18n.t("ancestry.exclude_self", class_name: self.class.name.humanize)) if ancestor_ids.include?(id)
+ errors.add(:base, I18n.t("ancestry.exclude_self", class_name: self.class.model_name.human)) if ancestor_ids.include?(id)
8
end
9
10
# Update descendants with new ancestry (after update)
0 commit comments