actualizar los consensos

This commit is contained in:
f 2020-02-22 16:20:40 -03:00
parent 48319358a6
commit 7f987654c5
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
3 changed files with 4 additions and 1 deletions

View file

@ -14,7 +14,7 @@ class ConsensosController < ApplicationController
#
# @return [Array] [ consensos ]
def index
@consensos = @barca.consensos.order(:created_at, :desc)
@consensos = @barca.consensos.order(:updated_at, :desc)
end
# GET /barcas/:barca_id/consensos/:id

View file

@ -26,6 +26,8 @@ class PosicionesController < ApplicationController
@posicion.try(:pirata=, current_pirata)
if @posicion.try(:save)
@consenso.touch
notify subject: :create
render status: :created
else

View file

@ -25,6 +25,7 @@ class PosicionesControllerTest < ActionDispatch::IntegrationTest
assert_equal estado, posicion.estado
assert_equal consenso, posicion.consenso
assert_not_equal consenso.updated_at, posicion.consenso.updated_at
assert_equal 'porque me place', posicion.comentario
end
end