Fixed CiServices validation

This commit is contained in:
Gabriel Mazetto 2015-12-15 17:37:23 -02:00
parent f479ed3066
commit 9072098215
2 changed files with 4 additions and 4 deletions

View file

@ -27,10 +27,10 @@ class BambooService < CiService
validates :build_key, presence: true, if: :activated?
validates :username,
presence: true,
if: ->(service) { service.activated? && service.password? }
if: ->(service) { service.activated? && service.password }
validates :password,
presence: true,
if: ->(service) { service.activated? && service.username? }
if: ->(service) { service.activated? && service.username }
attr_accessor :response

View file

@ -27,10 +27,10 @@ class TeamcityService < CiService
validates :build_type, presence: true, if: :activated?
validates :username,
presence: true,
if: ->(service) { service.activated? && service.password? }
if: ->(service) { service.activated? && service.password }
validates :password,
presence: true,
if: ->(service) { service.activated? && service.username? }
if: ->(service) { service.activated? && service.username }
attr_accessor :response