mirror of
https://github.com/meineerde/redmine.git
synced 2026-02-01 03:57:15 +00:00
Fix RuboCop offense Lint/SymbolConversion (#39887).
git-svn-id: https://svn.redmine.org/redmine/trunk@22531 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
c51e4937e7
commit
d9ef2d191c
@ -62,7 +62,7 @@ class SearchController < ApplicationController
|
||||
# don't search projects
|
||||
@object_types.delete('projects')
|
||||
# only show what the user is allowed to view
|
||||
@object_types = @object_types.select {|o| User.current.allowed_to?("view_#{o}".to_sym, projects_to_search)}
|
||||
@object_types = @object_types.select {|o| User.current.allowed_to?(:"view_#{o}", projects_to_search)}
|
||||
end
|
||||
|
||||
@scope = @object_types.select {|t| params[t].present?}
|
||||
|
||||
@ -30,7 +30,7 @@ module QueriesHelper
|
||||
group = (field_options[:through] || field_options[:field]).try(:name)
|
||||
elsif field =~ /^(.+)\./
|
||||
# association filters
|
||||
group = "field_#{$1}".to_sym
|
||||
group = :"field_#{$1}"
|
||||
elsif field_options[:type] == :relation
|
||||
group = :label_relations
|
||||
elsif field_options[:type] == :tree
|
||||
|
||||
@ -81,7 +81,7 @@ module VersionsHelper
|
||||
end
|
||||
|
||||
def status_by_options_for_select(value)
|
||||
options_for_select(STATUS_BY_CRITERIAS.collect {|criteria| [l("field_#{criteria}".to_sym), criteria]}, value)
|
||||
options_for_select(STATUS_BY_CRITERIAS.collect {|criteria| [l(:"field_#{criteria}"), criteria]}, value)
|
||||
end
|
||||
|
||||
def link_to_new_issue(version, project)
|
||||
|
||||
@ -46,7 +46,7 @@ module WatchersHelper
|
||||
|
||||
# Returns a comma separated list of users watching the given object
|
||||
def watchers_list(object)
|
||||
remove_allowed = User.current.allowed_to?("delete_#{object.class.name.underscore}_watchers".to_sym, object.project)
|
||||
remove_allowed = User.current.allowed_to?(:"delete_#{object.class.name.underscore}_watchers", object.project)
|
||||
content = ''.html_safe
|
||||
lis = object.watcher_users.sorted.collect do |user|
|
||||
s = ''.html_safe
|
||||
|
||||
@ -837,7 +837,7 @@ class IssueQuery < Query
|
||||
alias :find_author_id_filter_values :find_assigned_to_id_filter_values
|
||||
|
||||
IssueRelation::TYPES.each_key do |relation_type|
|
||||
alias_method "sql_for_#{relation_type}_field".to_sym, :sql_for_relations
|
||||
alias_method :"sql_for_#{relation_type}_field", :sql_for_relations
|
||||
end
|
||||
|
||||
def joins_for_order_statement(order_options)
|
||||
|
||||
@ -376,7 +376,7 @@ class MailHandler < ActionMailer::Base
|
||||
# Adds To and Cc as watchers of the given object if the sender has the
|
||||
# appropriate permission
|
||||
def add_watchers(obj)
|
||||
if handler_options[:no_permission_check] || user.allowed_to?("add_#{obj.class.name.underscore}_watchers".to_sym, obj.project)
|
||||
if handler_options[:no_permission_check] || user.allowed_to?(:"add_#{obj.class.name.underscore}_watchers", obj.project)
|
||||
addresses = [email.to, email.cc].flatten.compact.uniq.collect {|a| a.strip.downcase}
|
||||
unless addresses.empty?
|
||||
users = User.active.having_mail(addresses).to_a
|
||||
|
||||
@ -30,7 +30,7 @@ class QueryColumn
|
||||
self.totalable = options[:totalable] || false
|
||||
self.default_order = options[:default_order]
|
||||
@inline = options.key?(:inline) ? options[:inline] : true
|
||||
@caption_key = options[:caption] || "field_#{name}".to_sym
|
||||
@caption_key = options[:caption] || :"field_#{name}"
|
||||
@frozen = options[:frozen]
|
||||
end
|
||||
|
||||
@ -108,7 +108,7 @@ class QueryAssociationColumn < QueryColumn
|
||||
def initialize(association, attribute, options={})
|
||||
@association = association
|
||||
@attribute = attribute
|
||||
name_with_assoc = "#{association}.#{attribute}".to_sym
|
||||
name_with_assoc = :"#{association}.#{attribute}"
|
||||
super(name_with_assoc, options)
|
||||
end
|
||||
|
||||
@ -126,7 +126,7 @@ end
|
||||
|
||||
class QueryCustomFieldColumn < QueryColumn
|
||||
def initialize(custom_field, options={})
|
||||
name = "cf_#{custom_field.id}".to_sym
|
||||
name = :"cf_#{custom_field.id}"
|
||||
super(
|
||||
name,
|
||||
:sortable => custom_field.order_statement || false,
|
||||
@ -181,7 +181,7 @@ end
|
||||
class QueryAssociationCustomFieldColumn < QueryCustomFieldColumn
|
||||
def initialize(association, custom_field, options={})
|
||||
super(custom_field, options)
|
||||
self.name = "#{association}.cf_#{custom_field.id}".to_sym
|
||||
self.name = :"#{association}.cf_#{custom_field.id}"
|
||||
# TODO: support sorting by association custom field
|
||||
self.sortable = false
|
||||
self.groupable = false
|
||||
|
||||
@ -45,7 +45,7 @@ module Redmine
|
||||
options = provider.activity_provider_options[event_type]
|
||||
permission = options[:permission]
|
||||
unless options.key?(:permission)
|
||||
permission ||= "view_#{event_type}".to_sym
|
||||
permission ||= :"view_#{event_type}"
|
||||
end
|
||||
if permission
|
||||
keep |= projects.any? {|p| @user.allowed_to?(permission, p)}
|
||||
|
||||
@ -43,7 +43,7 @@ module Redmine
|
||||
end
|
||||
|
||||
def l_or_humanize(s, options={})
|
||||
k = "#{options[:prefix]}#{s}".to_sym
|
||||
k = :"#{options[:prefix]}#{s}"
|
||||
::I18n.t(k, :default => s.to_s.humanize)
|
||||
end
|
||||
|
||||
|
||||
@ -2099,7 +2099,7 @@ class QueryTest < ActiveSupport::TestCase
|
||||
:field_format => 'user'
|
||||
)
|
||||
q = IssueQuery.new
|
||||
assert q.groupable_columns.detect {|c| c.name == "cf_#{cf.id}".to_sym}
|
||||
assert q.groupable_columns.detect {|c| c.name == :"cf_#{cf.id}"}
|
||||
end
|
||||
|
||||
def test_groupable_columns_should_include_version_custom_fields
|
||||
@ -2109,7 +2109,7 @@ class QueryTest < ActiveSupport::TestCase
|
||||
:tracker_ids => [1], :field_format => 'version'
|
||||
)
|
||||
q = IssueQuery.new
|
||||
assert q.groupable_columns.detect {|c| c.name == "cf_#{cf.id}".to_sym}
|
||||
assert q.groupable_columns.detect {|c| c.name == :"cf_#{cf.id}"}
|
||||
end
|
||||
|
||||
def test_grouped_with_valid_column
|
||||
@ -2360,13 +2360,13 @@ class QueryTest < ActiveSupport::TestCase
|
||||
def test_available_totalable_columns_should_include_int_custom_field
|
||||
field = IssueCustomField.generate!(:field_format => 'int', :is_for_all => true)
|
||||
q = IssueQuery.new
|
||||
assert_include "cf_#{field.id}".to_sym, q.available_totalable_columns.map(&:name)
|
||||
assert_include :"cf_#{field.id}", q.available_totalable_columns.map(&:name)
|
||||
end
|
||||
|
||||
def test_available_totalable_columns_should_include_float_custom_field
|
||||
field = IssueCustomField.generate!(:field_format => 'float', :is_for_all => true)
|
||||
q = IssueQuery.new
|
||||
assert_include "cf_#{field.id}".to_sym, q.available_totalable_columns.map(&:name)
|
||||
assert_include :"cf_#{field.id}", q.available_totalable_columns.map(&:name)
|
||||
end
|
||||
|
||||
def test_available_totalable_columns_should_sort_in_position_order_for_custom_field
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user