Skip to content

Commit

Permalink
update_attribute was changed to update_column.
Browse files Browse the repository at this point in the history
  • Loading branch information
ugisozols authored and parndt committed Sep 2, 2013
1 parent 0c55cd8 commit 83b8bd2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/lib/refinery/crud.rb
Expand Up @@ -284,7 +284,7 @@ def update_positions
@current_#{singular_name}.move_to_root
end
else
@current_#{singular_name}.update_attributes :position => index
@current_#{singular_name}.update_column(:position, index)
end
if hash['children'].present?
Expand Down
2 changes: 1 addition & 1 deletion pages/app/models/refinery/page.rb
Expand Up @@ -203,7 +203,7 @@ def deletable?
# This ensures that they are in the correct 0,1,2,3,4... etc order.
def reposition_parts!
reload.parts.each_with_index do |part, index|
part.update_attributes :position => index
part.update_column(:position, index)
end
end

Expand Down
4 changes: 2 additions & 2 deletions pages/spec/models/refinery/page_spec.rb
Expand Up @@ -339,8 +339,8 @@ def turn_on_slug_scoping
it 'reposition correctly' do
page.save

page.parts.first.update_attributes :position => 6
page.parts.last.update_attributes :position => 4
page.parts.first.update_column(:position, 6)
page.parts.last.update_column(:position, 4)

page.parts.first.position.should == 6
page.parts.last.position.should == 4
Expand Down

0 comments on commit 83b8bd2

Please sign in to comment.