Commit 482fc553 authored by James Lopez's avatar James Lopez

fix validation error on services

parent 4376be84
......@@ -2,7 +2,7 @@ class EmailsOnPushService < Service
boolean_accessor :send_from_committer_email
boolean_accessor :disable_diffs
prop_accessor :recipients
validates :recipients, presence: true, if: :activated?
validates :recipients, presence: true, if: :activated?, unless: :importing?
def title
'Emails on push'
......
......@@ -4,7 +4,7 @@ class IrkerService < Service
prop_accessor :server_host, :server_port, :default_irc_uri
prop_accessor :recipients, :channels
boolean_accessor :colorize_messages
validates :recipients, presence: true, if: :activated?
validates :recipients, presence: true, if: :activated?, unless: :importing?
before_validation :get_channels
......
class PipelinesEmailService < Service
prop_accessor :recipients
boolean_accessor :notify_only_broken_pipelines
validates :recipients, presence: true, if: :activated?
validates :recipients, presence: true, if: :activated?, unless: :importing?
def initialize_properties
self.properties ||= { notify_only_broken_pipelines: true }
......
......@@ -2,6 +2,8 @@
# and implement a set of methods
class Service < ActiveRecord::Base
include Sortable
include Importable
serialize :properties, JSON # rubocop:disable Cop/ActiveRecordSerialize
default_value_for :active, false
......
......@@ -7096,7 +7096,7 @@
"project_id": 5,
"created_at": "2016-06-14T15:01:51.232Z",
"updated_at": "2016-06-14T15:01:51.232Z",
"active": false,
"active": true,
"properties": {
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment