diff options
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 |