Skip to content

Commit d418cf8

Browse files
committed
Map ancestors to strings before checking for ForbiddenAttributesProtection class
1 parent 7756a0e commit d418cf8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/active_admin/globalize3/active_record_extension.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ def active_admin_translates(*args, &block)
1717
translation_class.instance_eval &block
1818
end
1919

20-
unless translation_class.ancestors.include? ::ActiveModel::ForbiddenAttributesProtection
20+
unless translation_class.ancestors.map(&:to_s).include?('ActiveModel::ForbiddenAttributesProtection')
2121
translation_class.attr_accessible :locale
2222
translation_class.attr_accessible *args
2323
end
2424

25-
attr_accessible :translations_attributes unless ancestors.include? ::ActiveModel::ForbiddenAttributesProtection
25+
attr_accessible :translations_attributes unless ancestors.map(&:to_s).include?('ActiveModel::ForbiddenAttributesProtection')
2626
accepts_nested_attributes_for :translations, allow_destroy: true
2727

2828
include Methods

0 commit comments

Comments
 (0)