]> source.dussan.org Git - redmine.git/commitdiff
scm: add a repository model method "merge_extra_info()" to merge "extra_info" seriali...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 12 May 2011 23:58:38 +0000 (23:58 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 12 May 2011 23:58:38 +0000 (23:58 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5766 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/repository.rb

index 47471ca9215b17ad58922f3aa492dc2c80fb5a9f..de2720661d9b7bd7a182a0b83d800171ca6216f4 100644 (file)
@@ -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