OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Rubocop fix all valdiations in Meeting and RecurringMeeting
Klaus Zanders02b3a71b345c
diff --git a/modules/meeting/app/models/meeting.rb b/modules/meeting/app/models/meeting.rbindex 84960c3d173..39c9d75689d 100644--- a/modules/meeting/app/models/meeting.rb+++ b/modules/meeting/app/models/meeting.rb@@ -115,9 +115,9 @@ class Meeting < ApplicationRecordaccepts_nested_attributes_for :participants, allow_destroy: true- validates_presence_of :title, :project_id+ validates :title, :project_id, presence: true- validates_numericality_of :duration, greater_than: 0+ validates :duration, numericality: { greater_than: 0 }before_save :add_new_participants_as_watcherdiff --git a/modules/meeting/app/models/recurring_meeting.rb b/modules/meeting/app/models/recurring_meeting.rbindex 1fa158e6f84..394b9b9547c 100644--- a/modules/meeting/app/models/recurring_meeting.rb+++ b/modules/meeting/app/models/recurring_meeting.rb@@ -40,18 +40,18 @@ class RecurringMeeting < ApplicationRecordbelongs_to :projectbelongs_to :author, class_name: "User"- validates_presence_of :start_time, :title, :frequency, :end_after, :time_zone- validates_presence_of :end_date, if: -> { end_after_specific_date? }- validates_numericality_of :iterations,- only_integer: true,+ validates :start_time, :title, :frequency, :end_after, :time_zone, presence: true+ validates :end_date, presence: { if: -> { end_after_specific_date? } }+ validates :iterations,+ numericality: { only_integer: true,greater_than_or_equal_to: 1,less_than_or_equal_to: MAX_ITERATIONS,- if: -> { end_after_iterations? }- validates_numericality_of :interval,- only_integer: true,+ if: -> { end_after_iterations? } }+ validates :interval,+ numericality: { only_integer: true,greater_than_or_equal_to: 1,less_than_or_equal_to: MAX_INTERVAL,- if: -> { !frequency_working_days? }+ if: -> { !frequency_working_days? } }validate :end_date_constraints,if: -> { end_after_specific_date? }@@ -61,8 +61,8 @@ class RecurringMeeting < ApplicationRecord# Unset any previously set schedule before running validationsbefore_validation :unset_schedule- after_save :unset_schedulebefore_destroy :remove_jobs+ after_save :unset_scheduleenum :frequency,{