# File lib/globalize/active_record/migration.rb, line 121 def move_data_to_model_table add_missing_columns # Find all of the translated attributes for all records in the model. all_translated_attributes = @model.all.collect{|m| m.attributes} all_translated_attributes.each do |translated_record| # Create a hash containing the translated column names and their values. translated_attribute_names.inject(fields_to_update={}) do |f, name| f.update({name.to_sym => translated_record[name.to_s]}) end # Now, update the actual model's record with the hash. @model.update_all(fields_to_update, {:id => translated_record['id']}) end end