To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / db / migrate / 20110228000100_copy_repositories_log_encoding.rb @ 441:cbce1fd3b1b7

History | View | Annotate | Download (497 Bytes)

1
class CopyRepositoriesLogEncoding < ActiveRecord::Migration
2
  def self.up
3
    encoding = Setting.commit_logs_encoding.to_s.strip
4
    encoding = encoding.blank? ? 'UTF-8' : encoding
5
    Repository.find(:all).each do |repo|
6
      scm = repo.scm_name
7
      case scm
8
        when 'Subversion', 'Mercurial', 'Git', 'Filesystem' 
9
          repo.update_attribute(:log_encoding, nil)
10
        else
11
          repo.update_attribute(:log_encoding, encoding)
12
      end
13
    end
14
  end
15

    
16
  def self.down
17
  end
18
end