diff options
author | Drew Blessing <drew.blessing@me.com> | 2014-09-11 10:48:29 -0500 |
---|---|---|
committer | Drew Blessing <drew.blessing@me.com> | 2014-09-11 18:41:03 -0500 |
commit | 09cdd94322d078b44d1eeddb6fbd67a889bed1c3 (patch) | |
tree | 1392dc6d6c8c79f6ba82d5186213f306a40379ee /app/models/service.rb | |
parent | 80174c16d6e28f751e6afc59f9ba28f8c6b792fc (diff) | |
download | gitlab-ce-09cdd94322d078b44d1eeddb6fbd67a889bed1c3.tar.gz |
Fix serialize migration. Fixes #7734
Diffstat (limited to 'app/models/service.rb')
-rw-r--r-- | app/models/service.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/app/models/service.rb b/app/models/service.rb index edfb31cbe08..1f3a6520473 100644 --- a/app/models/service.rb +++ b/app/models/service.rb @@ -17,7 +17,8 @@ class Service < ActiveRecord::Base serialize :properties, JSON default_value_for :active, false - default_value_for :properties, {} + + after_initialize :initialize_properties belongs_to :project has_one :service_hook @@ -32,6 +33,10 @@ class Service < ActiveRecord::Base :common end + def initialize_properties + self.properties = {} if properties.nil? + end + def title # implement inside child end |