diff --git a/app/models/record_category.rb b/app/models/record_category.rb index 34a4b0c..dfbd49b 100644 --- a/app/models/record_category.rb +++ b/app/models/record_category.rb @@ -28,13 +28,15 @@ def update_data(data_fields) end if do_rename self.records.each do |record| - data_fields.each do |row| - if row['oldkey'] and row['key'] != row['oldkey'] - record.data[row['key']] = record.data[row['oldkey']] - record.data.delete(row['oldkey']) - end + if record.data + data_fields.each do |row| + if row['oldkey'] and row['key'] != row['oldkey'] + record.data[row['key']] = record.data[row['oldkey']] + record.data.delete(row['oldkey']) + end + end + record.save! end - record.save! end end self.data = data_fields diff --git a/public/404.html b/public/404.html index 711d3f3..bf5b265 100644 --- a/public/404.html +++ b/public/404.html @@ -20,7 +20,7 @@

The page you were looking for doesn't exist.

-

You may have mistyped the address or the page may have moved. (This is probably my faoult, so please e-mail me at sacha@sachachua.com and tell me what you think might be going on. =) )

+

You may have mistyped the address or the page may have moved. (This is probably my fault, so please e-mail me at sacha@sachachua.com and tell me what you think might be going on. =) )