Facepalm for me...
I've mentioned in my question:
I've already tried to verify if
@status.changed?
, and it really didn't.
It did change when I put something different in one of the model attributes, but I've only asked .changed?
after saving my @status
model. I'm really sorry about it, I'm yet just figuring out how Ruby on Rais works.
That said, I've came up with a solution to my problem, that was just setting the only one attribute of my model (except the id
, of course) with the value from the params[:status]
hash. And BEFORE saving it, I ask if @status.changed?
. If it doesn't, I redirect_to
the unchanged @status
, otherwise, I just save it and go through the old code.
Of course that doesn't cover all my scenario, since I also have to check if my @document
model has changed, but this is not the scope of this question.