Skip to content

Commit

Permalink
attr_protected requires a database connection.
Browse files Browse the repository at this point in the history
This might not be the best change, as the columns are now exposed; but, having attr_protected it here causes 'rake assets:precompile' to crash if the class is loaded on app boot.  Perhaps it's best to suggest the use of attr_accessible.
  • Loading branch information
jswanner committed Oct 20, 2011
1 parent 7ecd93a commit cd78620
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
5 changes: 0 additions & 5 deletions lib/awesome_nested_set/awesome_nested_set.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ def acts_as_nested_set(options = {})


attr_accessor :skip_before_destroy attr_accessor :skip_before_destroy


# no bulk assignment
if accessible_attributes.blank?
attr_protected left_column_name.intern, right_column_name.intern
end

before_create :set_default_left_and_right before_create :set_default_left_and_right
before_save :store_new_parent before_save :store_new_parent
after_save :move_to_new_parent after_save :move_to_new_parent
Expand Down
6 changes: 0 additions & 6 deletions spec/awesome_nested_set_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -74,12 +74,6 @@
}.should raise_exception(ActiveRecord::ActiveRecordError) }.should raise_exception(ActiveRecord::ActiveRecordError)
end end


it "colums_protected_on_initialize" do
c = Category.new(:lft => 1, :rgt => 2)
c.lft.should be_nil
c.rgt.should be_nil
end

it "scoped_appends_id" do it "scoped_appends_id" do
ScopedCategory.acts_as_nested_set_options[:scope].should == :organization_id ScopedCategory.acts_as_nested_set_options[:scope].should == :organization_id
end end
Expand Down

0 comments on commit cd78620

Please sign in to comment.