Project

General

Profile

Patch #29305 ยป replace-each-with-each_key.diff

Go MAEDA, 2018-07-31 23:53

View differences:

app/models/issue_query.rb (working copy)
582 582
  end
583 583
  alias :find_author_id_filter_values :find_assigned_to_id_filter_values
584 584

  
585
  IssueRelation::TYPES.keys.each do |relation_type|
585
  IssueRelation::TYPES.each_key do |relation_type|
586 586
    alias_method "sql_for_#{relation_type}_field".to_sym, :sql_for_relations
587 587
  end
588 588

  
app/models/query.rb (working copy)
371 371
      self.filters = {}
372 372
      add_filters(params[:fields] || params[:f], params[:operators] || params[:op], params[:values] || params[:v])
373 373
    else
374
      available_filters.keys.each do |field|
374
      available_filters.each_key do |field|
375 375
        add_short_filter(field, params[field]) if params[field]
376 376
      end
377 377
    end
......
989 989

  
990 990
  def map_total(total, &block)
991 991
    if total.is_a?(Hash)
992
      total.keys.each {|k| total[k] = yield total[k]}
992
      total.each_key {|k| total[k] = yield total[k]}
993 993
    else
994 994
      total = yield total
995 995
    end
app/models/user_preference.rb (working copy)
122 122
  #   preferences.remove_block('news')
123 123
  def remove_block(block)
124 124
    block = block.to_s.underscore
125
    my_page_layout.keys.each do |group|
125
    my_page_layout.each_key do |group|
126 126
      my_page_layout[group].delete(block)
127 127
    end
128 128
    my_page_layout
lib/plugins/open_id_authentication/lib/open_id_authentication.rb (working copy)
61 61
      @code
62 62
    end
63 63

  
64
    ERROR_MESSAGES.keys.each { |state| define_method("#{state}?") { @code == state } }
64
    ERROR_MESSAGES.each_key { |state| define_method("#{state}?") { @code == state } }
65 65

  
66 66
    def successful?
67 67
      @code == :successful
lib/redmine/helpers/gantt.rb (working copy)
608 608
          end
609 609
        end
610 610
        # Transforms dates into pixels witdh
611
        coords.keys.each do |key|
611
        coords.each_key do |key|
612 612
          coords[key] = (coords[key] * zoom).floor
613 613
        end
614 614
        coords
    (1-1/1)