diff options
-rw-r--r-- | app/controllers/search_controller.rb | 2 | ||||
-rw-r--r-- | app/helpers/queries_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/versions_helper.rb | 2 | ||||
-rw-r--r-- | app/helpers/watchers_helper.rb | 2 | ||||
-rw-r--r-- | app/models/issue_query.rb | 2 | ||||
-rw-r--r-- | app/models/mail_handler.rb | 2 | ||||
-rw-r--r-- | app/models/query.rb | 8 | ||||
-rw-r--r-- | lib/redmine/activity/fetcher.rb | 2 | ||||
-rw-r--r-- | lib/redmine/i18n.rb | 2 | ||||
-rw-r--r-- | test/unit/query_test.rb | 8 |
10 files changed, 16 insertions, 16 deletions
diff --git a/app/controllers/search_controller.rb b/app/controllers/search_controller.rb index a13b9932e..bc0905c90 100644 --- a/app/controllers/search_controller.rb +++ b/app/controllers/search_controller.rb @@ -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?} diff --git a/app/helpers/queries_helper.rb b/app/helpers/queries_helper.rb index d2505ff6f..92459ae00 100644 --- a/app/helpers/queries_helper.rb +++ b/app/helpers/queries_helper.rb @@ -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 diff --git a/app/helpers/versions_helper.rb b/app/helpers/versions_helper.rb index 54f553d48..694318e2e 100644 --- a/app/helpers/versions_helper.rb +++ b/app/helpers/versions_helper.rb @@ -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) diff --git a/app/helpers/watchers_helper.rb b/app/helpers/watchers_helper.rb index d8a1e0775..0bbd8fcab 100644 --- a/app/helpers/watchers_helper.rb +++ b/app/helpers/watchers_helper.rb @@ -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 diff --git a/app/models/issue_query.rb b/app/models/issue_query.rb index 1e08794dd..037d5a257 100644 --- a/app/models/issue_query.rb +++ b/app/models/issue_query.rb @@ -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) diff --git a/app/models/mail_handler.rb b/app/models/mail_handler.rb index 6d53530a8..ecedd2ccf 100644 --- a/app/models/mail_handler.rb +++ b/app/models/mail_handler.rb @@ -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 diff --git a/app/models/query.rb b/app/models/query.rb index 3208dc535..f0c29ea98 100644 --- a/app/models/query.rb +++ b/app/models/query.rb @@ -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 diff --git a/lib/redmine/activity/fetcher.rb b/lib/redmine/activity/fetcher.rb index 9fc914a58..54c177586 100644 --- a/lib/redmine/activity/fetcher.rb +++ b/lib/redmine/activity/fetcher.rb @@ -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)} diff --git a/lib/redmine/i18n.rb b/lib/redmine/i18n.rb index 5421c45d5..8434cd9be 100644 --- a/lib/redmine/i18n.rb +++ b/lib/redmine/i18n.rb @@ -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 diff --git a/test/unit/query_test.rb b/test/unit/query_test.rb index f6db2aeea..a630f75d8 100644 --- a/test/unit/query_test.rb +++ b/test/unit/query_test.rb @@ -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 |