Skip to content

Commit 7458929

Browse files
committed
Merge branch 'master' of git://github.com/stefanoverna/activeadmin-globalize3
2 parents 0a29aab + e7c3574 commit 7458929

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/active_admin/globalize3/active_record_extension.rb

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ def active_admin_translates(*args, &block)
1616
if block
1717
translation_class.instance_eval &block
1818
end
19-
translation_class.attr_accessible :locale
20-
translation_class.attr_accessible *args
2119

22-
attr_accessible :translations_attributes
20+
unless translation_class.ancestors.include? ::ActiveModel::ForbiddenAttributesProtection
21+
translation_class.attr_accessible :locale
22+
translation_class.attr_accessible *args
23+
end
24+
25+
attr_accessible :translations_attributes unless ancestors.include? ::ActiveModel::ForbiddenAttributesProtection
2326
accepts_nested_attributes_for :translations, allow_destroy: true
2427

2528
include Methods
2629
end
2730

2831
end
2932
end
30-

0 commit comments

Comments
 (0)