summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2024-08-20 23:40:58 +0000
committerGo MAEDA <maeda@farend.jp>2024-08-20 23:40:58 +0000
commitc069ea3a2440f4cb0641abd4e3ddb6be5bd6bdb2 (patch)
treed0bc8c17978db11a5a5526196b9c673132d33c60 /lib
parent86d262d5c57fc67250d254839f9400bfe853a9c1 (diff)
downloadredmine-c069ea3a2440f4cb0641abd4e3ddb6be5bd6bdb2.tar.gz
redmine-c069ea3a2440f4cb0641abd4e3ddb6be5bd6bdb2.zip
Use Array#intersect? introduced in Ruby 3.1 (#38585).
git-svn-id: https://svn.redmine.org/redmine/trunk@22972 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib')
-rw-r--r--lib/redmine/acts/positioned.rb2
-rw-r--r--lib/redmine/helpers/gantt.rb2
-rw-r--r--lib/redmine/wiki_formatting.rb2
3 files changed, 3 insertions, 3 deletions
diff --git a/lib/redmine/acts/positioned.rb b/lib/redmine/acts/positioned.rb
index adcbac8b9..efb9d2d60 100644
--- a/lib/redmine/acts/positioned.rb
+++ b/lib/redmine/acts/positioned.rb
@@ -100,7 +100,7 @@ module Redmine
end
def position_scope_changed?
- (saved_changes.keys & self.class.positioned_options[:scope].map(&:to_s)).any?
+ saved_changes.keys.intersect?(self.class.positioned_options[:scope].map(&:to_s))
end
def shift_positions
diff --git a/lib/redmine/helpers/gantt.rb b/lib/redmine/helpers/gantt.rb
index 6802c4342..ad676ec6f 100644
--- a/lib/redmine/helpers/gantt.rb
+++ b/lib/redmine/helpers/gantt.rb
@@ -768,7 +768,7 @@ module Redmine
children = object.leaf? ? [] : object.children & project_issues(object.project)
has_children =
children.present? &&
- (children.collect(&:fixed_version).uniq & [object.fixed_version]).present?
+ children.collect(&:fixed_version).uniq.intersect?([object.fixed_version])
when Version
tag_options[:id] = "version-#{object.id}"
tag_options[:class] = "version-name"
diff --git a/lib/redmine/wiki_formatting.rb b/lib/redmine/wiki_formatting.rb
index cc68e9972..558d3e117 100644
--- a/lib/redmine/wiki_formatting.rb
+++ b/lib/redmine/wiki_formatting.rb
@@ -103,7 +103,7 @@ module Redmine
# Returns true if the text formatter supports single section edit
def supports_section_edit?
- (formatter.instance_methods & ['update_section', :update_section]).any?
+ formatter.instance_methods.intersect?(['update_section', :update_section])
end
# Returns a cache key for the given text +format+, +text+, +object+ and +attribute+ or nil if no caching should be done