Browse Source

Using update instead of update_attributes

remotes/origin/master
echarp 4 years ago
parent
commit
cf3e6274eb
  1. 2
      app/controllers/moderations_controller.rb
  2. 2
      test/controllers/orgas_controller_test.rb
  3. 2
      test/mailers/orga_mailer_test.rb

2
app/controllers/moderations_controller.rb

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

2
test/controllers/orgas_controller_test.rb

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

2
test/mailers/orga_mailer_test.rb

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

Loading…
Cancel
Save