1
0

Added test_create_binding_target

Goals (incl. binding) are required to have targets
Plugin fixtures are available through accessors
This commit is contained in:
cryptogopher
2020-08-20 21:52:18 +02:00
parent 13974e5e2f
commit f9ba308072
21 changed files with 103 additions and 27 deletions

View File

@@ -8,7 +8,8 @@ class Goal < ActiveRecord::Base
validates :target_exposures, presence: true
validates :is_binding, uniqueness: {scope: :project_id}, if: :is_binding?
validates :name, presence: true, uniqueness: {scope: :project_id}
validates :name, presence: true, uniqueness: {scope: :project_id},
exclusion: {in: [I18n.t('targets.form.binding_goal')], unless: :is_binding?}
after_initialize do
if new_record?