annotate db/migrate/.svn/text-base/20110228000100_copy_repositories_log_encoding.rb.svn-base @ 607:bdaabf6ee591 feature_36

added the @author_options array to the create action so that the validations still work
author luisf <luis.figueira@eecs.qmul.ac.uk>
date Thu, 18 Aug 2011 17:44:12 +0100
parents 051f544170fe
children
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