From: Toshi MARUYAMA Date: Thu, 12 May 2011 23:58:38 +0000 (+0000) Subject: scm: add a repository model method "merge_extra_info()" to merge "extra_info" seriali... X-Git-Tag: 1.2.0~127 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=4ee79a60efa1a4a8dc6ceabc92634ea2269d1095;p=redmine.git scm: add a repository model method "merge_extra_info()" to merge "extra_info" serializing hash yaml (#7146, #7047). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5766 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/repository.rb b/app/models/repository.rb index 47471ca92..de2720661 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -73,6 +73,13 @@ class Repository < ActiveRecord::Base self.class.scm_name end + def merge_extra_info(arg) + h = extra_info || {} + return h if arg.nil? + h.merge!(arg) + write_attribute(:extra_info, h) + end + def supports_cat? scm.supports_cat? end