mirror of
				https://github.com/redmine/redmine.git
				synced 2025-10-31 02:15:52 +01:00 
			
		
		
		
	Rails3: replace deprecated 'before_create' to declared method at Changeset model.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6744 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
		| @@ -45,6 +45,7 @@ class Changeset < ActiveRecord::Base | |||||||
|                                           :conditions => Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args) } } |                                           :conditions => Project.allowed_to_condition(args.shift || User.current, :view_changesets, *args) } } | ||||||
|  |  | ||||||
|   after_create :scan_for_issues |   after_create :scan_for_issues | ||||||
|  |   before_create :before_create_cs | ||||||
|  |  | ||||||
|   def revision=(r) |   def revision=(r) | ||||||
|     write_attribute :revision, (r.nil? ? nil : r.to_s) |     write_attribute :revision, (r.nil? ? nil : r.to_s) | ||||||
| @@ -81,7 +82,7 @@ class Changeset < ActiveRecord::Base | |||||||
|     user || committer.to_s.split('<').first |     user || committer.to_s.split('<').first | ||||||
|   end |   end | ||||||
|  |  | ||||||
|   def before_create |   def before_create_cs | ||||||
|     self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding) |     self.committer = self.class.to_utf8(self.committer, repository.repo_log_encoding) | ||||||
|     self.comments  = self.class.normalize_comments( |     self.comments  = self.class.normalize_comments( | ||||||
|                        self.comments, repository.repo_log_encoding) |                        self.comments, repository.repo_log_encoding) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user