activescaffold column overwrite – ugly

Perhaps this is somehow due to my config…but if it happens to me, it could happen to you:

I have a model, say table_one with a belongs_to: table_two. It happens that table_one and table_two each have a column named ‘datafile’. The two columns are intended to refer to entirely separate datafiles, and thru lack of imagination I named both the same. Now when I edit a row from table_one, it shows the associated row from table_two, and uses an identical name for the input fields for both ‘datafile’’s! record[datafile]

The result is that the datafile for table_one is wiped out on edit, as it is replaced by the blank datafile input for the associated record for table_two. Ouch!

Workaround of changing the name of the column in table_two fixes the problem.

Using activescaffold 3.0.5 for Rails 3.0

Leave a Reply