Using update instead of update_attributes

This commit is contained in:
echarp 2018-03-17 15:49:43 +01:00
parent 034e313eb9
commit cf3e6274eb
3 changed files with 3 additions and 3 deletions

View File

@ -24,7 +24,7 @@ class ModerationsController < ApplicationController
# PATCH/PUT /moderations/1.json # PATCH/PUT /moderations/1.json
def update def update
respond_to do |format| respond_to do |format|
if @moderation.update_attributes moderation_params if @moderation.update moderation_params
format.html { redirect_to :moderations, notice: t('.ok') } format.html { redirect_to :moderations, notice: t('.ok') }
format.json { head :no_content } format.json { head :no_content }
else else

View File

@ -71,7 +71,7 @@ class OrgasControllerTest < ActionDispatch::IntegrationTest
test 'should update orga' do test 'should update orga' do
# Necessary to have the proper paper_trail version # Necessary to have the proper paper_trail version
@orga.update_attributes name: 'My Title' @orga.update name: 'My Title'
patch orga_url(@orga), params: { patch orga_url(@orga), params: {
secret: @orga.secret, secret: @orga.secret,

View File

@ -21,7 +21,7 @@ class OrgaMailerTest < ActionMailer::TestCase
test 'update' do test 'update' do
@orga = Orga.last @orga = Orga.last
# Necessary to have the proper paper_trail version # Necessary to have the proper paper_trail version
@orga.update_attributes name: 'My Title' @orga.update name: 'My Title'
mail = OrgaMailer.update @orga mail = OrgaMailer.update @orga
assert_match(/Organisation .* modifiée/, mail.subject) assert_match(/Organisation .* modifiée/, mail.subject)
assert_equal [Orga.last.submitter], mail.to assert_equal [Orga.last.submitter], mail.to