From 4379712e856d77b6f3d8551f3f904b29921db49d Mon Sep 17 00:00:00 2001 From: Matthew McEachen Date: Fri, 7 Jun 2013 21:11:46 -0700 Subject: [PATCH] fix use_attr_accessible? --- lib/closure_tree/support.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/closure_tree/support.rb b/lib/closure_tree/support.rb index 3f6f03f7..883eb22c 100644 --- a/lib/closure_tree/support.rb +++ b/lib/closure_tree/support.rb @@ -23,7 +23,8 @@ def connection def use_attr_accessible? ActiveRecord::VERSION::MAJOR == 3 && defined?(ActiveModel::MassAssignmentSecurity) && - model_class.accessible_attributes.empty? + model_class.respond_to?(:accessible_attributes) && + model_class.accessible_attributes.present? end def include_forbidden_attributes_protection?