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
refactoring: use positive conditions
Christophe Bliarde9eed2cdd388
diff --git a/app/views/common/feed.atom.builder b/app/views/common/feed.atom.builderindex 84a6383a020..c243b0bdc87 100644--- a/app/views/common/feed.atom.builder+++ b/app/views/common/feed.atom.builder@@ -60,7 +60,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" doif authorxml.author doxml.name(author)- xml.email(author.mail) if author.is_a?(User) && author.mail.present? && !author.pref.hide_mail+ xml.email(author.mail) if author.is_a?(User) && author.mail.present? && author.pref.can_expose_mail?endendxml.content "type" => "html" dodiff --git a/app/views/journals/index.atom.builder b/app/views/journals/index.atom.builderindex c96f4d7c387..3f873ddc27e 100644--- a/app/views/journals/index.atom.builder+++ b/app/views/journals/index.atom.builder@@ -44,7 +44,7 @@ xml.feed "xmlns" => "http://www.w3.org/2005/Atom" doxml.updated change.created_at.xmlschemaxml.author doxml.name change.user.name- xml.email(change.user.mail) if change.user.is_a?(User) && change.user.mail.present? && !change.user.pref.hide_mail+ xml.email(change.user.mail) if change.user.is_a?(User) && change.user.mail.present? && change.user.pref.can_expose_mail?endxml.content "type" => "html" doxml.text! '<ul>'diff --git a/lib/api/v3/users/user_representer.rb b/lib/api/v3/users/user_representer.rbindex d74d4d5df41..dab1227ae64 100644--- a/lib/api/v3/users/user_representer.rb+++ b/lib/api/v3/users/user_representer.rb@@ -143,7 +143,7 @@ module APIgetter: ->(*) { represented.mail },setter: ->(fragment:, represented:, **) { represented.mail = fragment },exec_context: :decorator,- cache_if: -> { !represented.pref.hide_mail || represented.new_record? || current_user_can_manage? }+ cache_if: -> { represented.pref.can_expose_mail? || represented.new_record? || current_user_can_manage? }property :avatar,exec_context: :decorator,