Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix attr_accessible handling #75

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion lib/closure_tree/support.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def initialize(model_class, options)
extend NumericOrderSupport.adapter_for_connection(connection)
end
end

def hierarchy_class_for_model
hierarchy_class = model_class.parent.const_set(short_hierarchy_class_name, Class.new(ActiveRecord::Base))
use_attr_accessible = use_attr_accessible?
Expand Down
2 changes: 1 addition & 1 deletion lib/closure_tree/support_flags.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ module SupportFlags
def use_attr_accessible?
defined?(ActiveModel::MassAssignmentSecurity) &&
model_class.respond_to?(:accessible_attributes) &&
model_class.accessible_attributes.present?
! model_class.accessible_attributes.nil?
end

def include_forbidden_attributes_protection?
Expand Down