diff --git a/lib/closure_tree/acts_as_tree.rb b/lib/closure_tree/acts_as_tree.rb index 84ac93e5..dae75453 100644 --- a/lib/closure_tree/acts_as_tree.rb +++ b/lib/closure_tree/acts_as_tree.rb @@ -50,7 +50,9 @@ def ==(comparison_object) :class_name => ct_class.to_s, :foreign_key => parent_column_name - attr_accessible :parent + unless defined?(ActiveModel::ForbiddenAttributesProtection) && ancestors.include?(ActiveModel::ForbiddenAttributesProtection) + attr_accessible :parent + end has_many :children, with_order_option( :class_name => ct_class.to_s,