fix update/save_without_callbacks for rails 3
replaces update_without_callbacks with save_without_callbacks in specs fixes ArgumentError: "tried to create Proc object without a block" Change-Id: I62275348cd9fff967d21646e7cd963c4b531790e Reviewed-on: https://gerrit.instructure.com/29255 Tested-by: Jenkins <jenkins@instructure.com> Reviewed-by: Cody Cutrer <cody@instructure.com> Product-Review: James Williams <jamesw@instructure.com> QA-Review: James Williams <jamesw@instructure.com>
This commit is contained in:
parent
cc4c82b71c
commit
bb31a022bb
|
@ -68,7 +68,7 @@ class ActiveRecord::Base
|
|||
elsif name == :save
|
||||
yield
|
||||
else
|
||||
run_callbacks_orig(name, &Proc.new)
|
||||
run_callbacks_orig(name, &Proc.new{})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -26,7 +26,7 @@ describe ClonedItem do
|
|||
cloned_item.original_item_type.should == 'Quizzes::Quiz'
|
||||
|
||||
cloned_item.original_item_type = 'Quiz'
|
||||
cloned_item.send(:update_without_callbacks)
|
||||
cloned_item.send(:save_without_callbacks)
|
||||
|
||||
ClonedItem.first.original_item_type.should == 'Quizzes::Quiz'
|
||||
end
|
||||
|
|
|
@ -408,7 +408,7 @@ describe ContentTag do
|
|||
content_tag.content_type.should == 'Quizzes::Quiz'
|
||||
|
||||
content_tag.content_type = 'Quiz'
|
||||
content_tag.send(:update_without_callbacks)
|
||||
content_tag.send(:save_without_callbacks)
|
||||
|
||||
ContentTag.find(content_tag.id).content_type.should == 'Quizzes::Quiz'
|
||||
end
|
||||
|
|
|
@ -39,7 +39,7 @@ describe LearningOutcomeResult do
|
|||
learning_outcome_result.association_type.should == 'Quizzes::Quiz'
|
||||
|
||||
learning_outcome_result.association_type = 'Quiz'
|
||||
learning_outcome_result.send(:update_without_callbacks)
|
||||
learning_outcome_result.send(:save_without_callbacks)
|
||||
|
||||
LearningOutcomeResult.first.association_type.should == 'Quizzes::Quiz'
|
||||
end
|
||||
|
@ -47,8 +47,7 @@ describe LearningOutcomeResult do
|
|||
it 'returns the association type attribute if not a quiz' do
|
||||
learning_outcome_result = create_learning_outcome_result
|
||||
learning_outcome_result.association_object = assignment_model
|
||||
learning_outcome_result.send(:update_without_callbacks)
|
||||
|
||||
learning_outcome_result.send(:save_without_callbacks)
|
||||
learning_outcome_result.association_type.should == 'Assignment'
|
||||
end
|
||||
end
|
||||
|
@ -59,7 +58,7 @@ describe LearningOutcomeResult do
|
|||
learning_outcome_result.associated_asset_type.should == 'Quizzes::Quiz'
|
||||
|
||||
learning_outcome_result.associated_asset_type = 'Quiz'
|
||||
learning_outcome_result.send(:update_without_callbacks)
|
||||
learning_outcome_result.send(:save_without_callbacks)
|
||||
|
||||
LearningOutcomeResult.first.associated_asset_type.should == 'Quizzes::Quiz'
|
||||
end
|
||||
|
@ -67,7 +66,7 @@ describe LearningOutcomeResult do
|
|||
it 'returns the associated asset type attribute if not a quiz' do
|
||||
learning_outcome_result = create_learning_outcome_result
|
||||
learning_outcome_result.associated_asset = assignment_model
|
||||
learning_outcome_result.send(:update_without_callbacks)
|
||||
learning_outcome_result.send(:save_without_callbacks)
|
||||
|
||||
learning_outcome_result.associated_asset_type.should == 'Assignment'
|
||||
end
|
||||
|
|
|
@ -31,7 +31,7 @@ describe PolymorphicTypeOverride do
|
|||
fizz_buzz.content_type.should == 'Quizzes::Quiz'
|
||||
|
||||
fizz_buzz.content_type = 'OldClassInDatabase'
|
||||
fizz_buzz.send(:update_without_callbacks)
|
||||
fizz_buzz.send(:save_without_callbacks)
|
||||
|
||||
updated_fizz_buzz = ContentTag.first
|
||||
updated_fizz_buzz.content_type.should == 'Quizzes::Quiz'
|
||||
|
@ -51,7 +51,7 @@ describe PolymorphicTypeOverride do
|
|||
|
||||
fizz_buzz.content_type = 'OldClassInDatabase'
|
||||
fizz_buzz.context_type = 'AnotherOldClassInDatabase'
|
||||
fizz_buzz.send(:update_without_callbacks)
|
||||
fizz_buzz.send(:save_without_callbacks)
|
||||
|
||||
updated_fizz_buzz = ContentTag.first
|
||||
|
||||
|
|
|
@ -351,7 +351,7 @@ describe "Outcome Reports" do
|
|||
# NOTE: remove after data migration of polymorphic relationships having: Quiz
|
||||
result = LearningOutcomeResult.where(association_type: 'Quizzes::Quiz').first
|
||||
result.association_type = 'Quiz'
|
||||
result.send(:update_without_callbacks)
|
||||
result.send(:save_without_callbacks)
|
||||
|
||||
parsed = read_report(@type, {order: [0, 13]})
|
||||
parsed[2][5].should == 'assignment'
|
||||
|
|
|
@ -152,7 +152,7 @@ describe 'simply_versioned' do
|
|||
version.versionable_type.should == 'Quizzes::Quiz'
|
||||
|
||||
version.versionable_type = 'Quiz'
|
||||
version.send(:update_without_callbacks)
|
||||
version.send(:save_without_callbacks)
|
||||
Version.find(version.id).versionable_type.should == 'Quizzes::Quiz'
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue