From af4ad4ad0a0856539aa3fcbbbe6265b592443529 Mon Sep 17 00:00:00 2001 From: James Miller Date: Mon, 17 Dec 2012 21:20:36 -0800 Subject: [PATCH] Add support for strong_parameters --- lib/closure_tree/acts_as_tree.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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,