Achille Achille Wed May 01 03:24:47 -0400 2013

Subject: Problem save and unknown field

Hi everyone,

I'm actually working on an upload system. To do so, I receive a file from my form. I'm actually using the "assign_attribute" method in order to add those "foreign" fields (file value) to my model (otherwise, I'll get an error saying that "tmp_name" is an unknown field) as follow :

Everything works well. My issue is when I tried to save the data in the database. Since I added my "media" variable to the Media model, the save method just can't save it since it does not recognize the "media" field.

here is my model :

Is there a way to delete it or make the save method doesn't taking care of unknown field?
I tried to do an unset of that variable ( unset($this->media) ) in my before_save method but it didn't solve the issue.

Thanks a lot for the help