Skip to content

Commit 73e9064

Browse files
authored
Merge pull request #700 from labeebklatif/humanize_model_name
Humanise model name for error message
2 parents 8cb0cbe + 47d762d commit 73e9064

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ancestry/instance_methods.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Ancestry
44
module InstanceMethods
55
# Validate that the ancestors don't include itself
66
def ancestry_exclude_self
7-
errors.add(:base, I18n.t("ancestry.exclude_self", class_name: self.class.name.humanize)) if ancestor_ids.include?(id)
7+
errors.add(:base, I18n.t("ancestry.exclude_self", class_name: self.class.model_name.human)) if ancestor_ids.include?(id)
88
end
99

1010
# Update descendants with new ancestry (after update)

0 commit comments

Comments
 (0)