Update_attributes unsets my object


#1

I just run in a very strange behavior.

In one of my actions, I trigger: @object.update_attributes(:attr1 =>
…)

Now in the corresponding view, @object is nil. Is that a normal behavior
from Rails? Why would it unset the object?


#2

On 20 Nov 2008, at 17:26, Fernando P. wrote:

I just run in a very strange behavior.

In one of my actions, I trigger: @object.update_attributes(:attr1 =>
…)

Now in the corresponding view, @object is nil. Is that a normal
behavior
from Rails? Why would it unset the object?

I doubt that is the whole story. Post more information

Ffred


#3

Frederick C. wrote:

On 20 Nov 2008, at 17:26, Fernando P. wrote:

I just run in a very strange behavior.

In one of my actions, I trigger: @object.update_attributes(:attr1 =>
…)

Now in the corresponding view, @object is nil. Is that a normal
behavior
from Rails? Why would it unset the object?

I doubt that is the whole story. Post more information

Ffred

Thank your Frederick for your prompt answer. You were perfectly right, I
hadn’t seen that I was doing something so stupid as:

@object.update_attributes(:attr1 => @object.attr1)

That kind of recursion is definitely forbidden. I don’t know how such a
silly idea came to my mind.