Skip to content

Commit 4379712

Browse files
committed
fix use_attr_accessible?
1 parent e72b0a1 commit 4379712

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/closure_tree/support.rb

+2-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ def connection
2323
def use_attr_accessible?
2424
ActiveRecord::VERSION::MAJOR == 3 &&
2525
defined?(ActiveModel::MassAssignmentSecurity) &&
26-
model_class.accessible_attributes.empty?
26+
model_class.respond_to?(:accessible_attributes) &&
27+
model_class.accessible_attributes.present?
2728
end
2829

2930
def include_forbidden_attributes_protection?

0 commit comments

Comments
 (0)