Use Array#intersect? introduced in Ruby 3.1 (#38585).

git-svn-id: https://svn.redmine.org/redmine/trunk@22972 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Go MAEDA
2024-08-20 23:40:58 +00:00
parent 86d262d5c5
commit c069ea3a24
11 changed files with 11 additions and 11 deletions

View File

@@ -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

View File

@@ -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"

View File

@@ -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