Commit 90720982 authored by Gabriel Mazetto's avatar Gabriel Mazetto

Fixed CiServices validation

parent f479ed30
...@@ -27,10 +27,10 @@ class BambooService < CiService ...@@ -27,10 +27,10 @@ class BambooService < CiService
validates :build_key, presence: true, if: :activated? validates :build_key, presence: true, if: :activated?
validates :username, validates :username,
presence: true, presence: true,
if: ->(service) { service.activated? && service.password? } if: ->(service) { service.activated? && service.password }
validates :password, validates :password,
presence: true, presence: true,
if: ->(service) { service.activated? && service.username? } if: ->(service) { service.activated? && service.username }
attr_accessor :response attr_accessor :response
......
...@@ -27,10 +27,10 @@ class TeamcityService < CiService ...@@ -27,10 +27,10 @@ class TeamcityService < CiService
validates :build_type, presence: true, if: :activated? validates :build_type, presence: true, if: :activated?
validates :username, validates :username,
presence: true, presence: true,
if: ->(service) { service.activated? && service.password? } if: ->(service) { service.activated? && service.password }
validates :password, validates :password,
presence: true, presence: true,
if: ->(service) { service.activated? && service.username? } if: ->(service) { service.activated? && service.username }
attr_accessor :response attr_accessor :response
......
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