Skip to content
Snippets Groups Projects

Set a limit of 255 characters for security policy names

Merged Sam White requested to merge sam-add-fullname-approval-rule into master
1 unresolved thread
2 files
+ 1
11
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -9,7 +9,6 @@ module ApprovalRuleLike
@@ -9,7 +9,6 @@ module ApprovalRuleLike
APPROVALS_REQUIRED_MAX = 100
APPROVALS_REQUIRED_MAX = 100
ALL_MEMBERS = 'All Members'
ALL_MEMBERS = 'All Members'
NEWLY_DETECTED = 'newly_detected'
NEWLY_DETECTED = 'newly_detected'
NAME_MAX_LENGTH = 255
included do
included do
has_and_belongs_to_many :users,
has_and_belongs_to_many :users,
@@ -26,7 +25,7 @@ module ApprovalRuleLike
@@ -26,7 +25,7 @@ module ApprovalRuleLike
scan_finding: 4
scan_finding: 4
}
}
validates :name, presence: true, length: { maximum: NAME_MAX_LENGTH }
validates :name, presence: true
validates :approvals_required, numericality: { less_than_or_equal_to: APPROVALS_REQUIRED_MAX, greater_than_or_equal_to: 0 }
validates :approvals_required, numericality: { less_than_or_equal_to: APPROVALS_REQUIRED_MAX, greater_than_or_equal_to: 0 }
validates :report_type, presence: true, if: :report_approver?
validates :report_type, presence: true, if: :report_approver?
Loading