annotate db/migrate/20110228000100_copy_repositories_log_encoding.rb @ 599:251b380117ce feature_227

Introduce a new latest_downloads plugin to manage active and shortcut for attachments. Add a table for attachment active/shortcut data. Move existing active-handler code into the new plugin (but still using the "old" active column in the attachments table). Note the files_controller stuff doesn't actually work here.
author Chris Cannam <chris.cannam@soundsoftware.ac.uk>
date Tue, 16 Aug 2011 17:01:19 +0100
parents 051f544170fe
children 433d4f72a19b
rev   line source
Chris@245 1 class CopyRepositoriesLogEncoding < ActiveRecord::Migration
Chris@245 2 def self.up
Chris@245 3 encoding = Setting.commit_logs_encoding.to_s.strip
Chris@245 4 encoding = encoding.blank? ? 'UTF-8' : encoding
Chris@245 5 Repository.find(:all).each do |repo|
Chris@245 6 scm = repo.scm_name
Chris@245 7 case scm
Chris@245 8 when 'Subversion', 'Mercurial', 'Git', 'Filesystem'
Chris@245 9 repo.update_attribute(:log_encoding, nil)
Chris@245 10 else
Chris@245 11 repo.update_attribute(:log_encoding, encoding)
Chris@245 12 end
Chris@245 13 end
Chris@245 14 end
Chris@245 15
Chris@245 16 def self.down
Chris@245 17 end
Chris@245 18 end