Merge pull request #43501 from henrik/destroy-bang-in-scaffolds
Use safer 'destroy!' in controller scaffolds
This commit is contained in:
commit
cd974d5616
|
@ -73,7 +73,7 @@ module Rails
|
|||
|
||||
# DELETE destroy
|
||||
def destroy
|
||||
"#{name}.destroy"
|
||||
"#{name}.destroy!"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -51,7 +51,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
|
|||
end
|
||||
|
||||
assert_instance_method :destroy, content do |m|
|
||||
assert_match(/@product_line\.destroy/, m)
|
||||
assert_match(/@product_line\.destroy!/, m)
|
||||
end
|
||||
|
||||
assert_instance_method :set_product_line, content do |m|
|
||||
|
@ -137,7 +137,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
|
|||
end
|
||||
|
||||
assert_instance_method :destroy, content do |m|
|
||||
assert_match(/@product_line\.destroy/, m)
|
||||
assert_match(/@product_line\.destroy!/, m)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -254,7 +254,7 @@ class ScaffoldGeneratorTest < Rails::Generators::TestCase
|
|||
end
|
||||
|
||||
assert_instance_method :destroy, content do |m|
|
||||
assert_match(/@admin_role\.destroy/, m)
|
||||
assert_match(/@admin_role\.destroy!/, m)
|
||||
end
|
||||
|
||||
assert_instance_method :set_admin_role, content do |m|
|
||||
|
|
Loading…
Reference in New Issue