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
linting
ulfertsaf5d400bb2eb
diff --git a/app/models/attribute_help_text.rb b/app/models/attribute_help_text.rbindex 978cab3ba8e..0660ba761b6 100644--- a/app/models/attribute_help_text.rb+++ b/app/models/attribute_help_text.rb@@ -54,11 +54,11 @@ class AttributeHelpText < ApplicationRecordscopeend- validates_presence_of :help_text- validates_uniqueness_of :attribute_name, scope: :type+ validates :help_text, presence: true+ validates :attribute_name, uniqueness: { scope: :type }def attribute_caption- @caption ||= self.class.available_attributes[attribute_name]+ @attribute_caption ||= self.class.available_attributes[attribute_name]enddef attribute_scopediff --git a/app/models/attribute_help_text/work_package.rb b/app/models/attribute_help_text/work_package.rbindex 844d080cca5..b9122246b59 100644--- a/app/models/attribute_help_text/work_package.rb+++ b/app/models/attribute_help_text/work_package.rb@@ -41,7 +41,7 @@ class AttributeHelpText::WorkPackage < AttributeHelpTextattributesend- validates_inclusion_of :attribute_name, in: ->(*) { available_attributes.keys }+ validates :attribute_name, inclusion: { in: ->(*) { available_attributes.keys } }def type_captionI18n.t(:label_work_package)diff --git a/spec/models/attribute_help_text/work_package_spec.rb b/spec/models/attribute_help_text/work_package_spec.rbindex 04e09392863..5318625cf81 100644--- a/spec/models/attribute_help_text/work_package_spec.rb+++ b/spec/models/attribute_help_text/work_package_spec.rb@@ -48,6 +48,7 @@ describe AttributeHelpText::WorkPackage, type: :model dodescribe '.available_attributes' dosubject { described_class.available_attributes }+it 'returns an array of potential attributes' doexpect(subject).to be_a Hashend@@ -55,6 +56,7 @@ describe AttributeHelpText::WorkPackage, type: :model dodescribe '.used_attributes' dolet!(:instance) { FactoryBot.create :work_package_help_text }+subject { described_class.used_attributes instance.type }it 'returns used attributes' do@@ -73,8 +75,6 @@ describe AttributeHelpText::WorkPackage, type: :model dolet(:permission) { [] }let(:static_instance) { FactoryBot.create :work_package_help_text, attribute_name: 'project' }- subject { FactoryBot.build :work_package_help_text }-before do# need to clear the cache to free the memoized# Type.translated_work_package_form_attributes