{"issue":{"pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"state":"open","user":{"avatar_url":"https://secure.gravatar.com/avatar/cf3ed91eed72fa093f7e99779135890b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cf3ed91eed72fa093f7e99779135890b","url":"https://api.github.com/users/ncri","login":"ncri","id":16925},"milestone":null,"assignee":null,"labels":[],"updated_at":"2011-10-28T12:07:52Z","comments":3,"closed_at":null,"url":"https://api.github.com/repos/svenfuchs/globalize3/issues/80","body":"I noticed when using the migrate_data option, my migrations became horribly slow (speaking about hours for a couple of hundred records ;-). I found out that the cause was the data migration that caused reassignment of all model attributes, triggering some complex overwritten setters and getters.\r\n\r\nI refactored the move_data_to_translation_table method to hopefully be much faster now:\r\n\r\n```\r\ndef move_data_to_translation_table\r\n  model.find_each do |record|\r\n    translation = record.translations.build(:locale => I18n.default_locale)\r\n    translated_attribute_names.each do |attribute|\r\n      translation[attribute] = record[attribute]\r\n    end\r\n    translation.save!\r\n  end\r\nend\r\n```\r\n\r\nAny issues with this? Otherwise I could supply a pull request, just need to figure out, why I can't get the globalize3 tests running so far - I get 33 errors. Do I have anything else todo besides running bundle?","html_url":"https://github.com/svenfuchs/globalize3/issues/80","number":80,"title":"data migration to translation table slow for complex models","id":2076186,"created_at":"2011-10-28T06:55:29Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/cf3ed91eed72fa093f7e99779135890b?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"cf3ed91eed72fa093f7e99779135890b","url":"https://api.github.com/users/ncri","login":"ncri","id":16925},"updated_at":"2011-10-28T12:07:52Z","url":"https://api.github.com/repos/svenfuchs/globalize3/issues/comments/2555366","body":"See: https://github.com/svenfuchs/globalize3/pull/81","id":2555366,"created_at":"2011-10-28T12:07:52Z"}}