Project

General

Profile

Feature #36320 » 0002-Fix-for-https-github.com-rails-rails-pull-47354.patch

Takashi Kato, 2024-08-20 01:00

View differences:

app/helpers/application_helper.rb
1869 1869
  def render_if_exist(options = {}, locals = {}, &block)
1870 1870
    # Remove test_render_if_exist_should_be_render_partial and test_render_if_exist_should_be_render_nil
1871 1871
    # along with this method in Redmine 7.0
1872
    ActiveSupport::Deprecation.warn 'ApplicationHelper#render_if_exist is deprecated and will be removed in Redmine 7.0.'
1872
    Rails.application.deprecators[:redmine].warn 'ApplicationHelper#render_if_exist is deprecated and will be removed in Redmine 7.0.'
1873 1873

  
1874 1874
    if options[:partial]
1875 1875
      if lookup_context.exists?(options[:partial], lookup_context.prefixes, true)
config/initializers/30-redmine.rb
40 40
    Rails.application.config.assets.redmine_extension_paths << paths if paths.present?
41 41
  end
42 42
end
43

  
44
Rails.application.deprecators[:redmine] = ActiveSupport::Deprecation.new('7.0', 'Redmine')
lib/plugins/acts_as_activity_provider/lib/acts_as_activity_provider.rb
61 61
            elsif scope.respond_to?(:call)
62 62
              scope = scope.call
63 63
            else
64
              ActiveSupport::Deprecation.warn "acts_as_activity_provider with implicit :scope option is deprecated. Please pass a scope on the #{self.name} as a proc."
64
              Rails.application.deprecators[:redmine].warn "acts_as_activity_provider with implicit :scope option is deprecated. Please pass a scope on the #{self.name} as a proc."
65 65
            end
66 66

  
67 67
            scope = scope.where("#{provider_options[:timestamp]} >= ?", from) if from
......
82 82
            elsif respond_to?(:visible)
83 83
              scope = scope.visible(user, options)
84 84
            else
85
              ActiveSupport::Deprecation.warn "acts_as_activity_provider with implicit :permission option is deprecated. Add a visible scope to the #{self.name} model or use explicit :permission option."
85
              Rails.application.deprecators[:redmine].warn "acts_as_activity_provider with implicit :permission option is deprecated. Add a visible scope to the #{self.name} model or use explicit :permission option."
86 86
              scope = scope.where(Project.allowed_to_condition(user, "view_#{self.name.underscore.pluralize}".to_sym, options))
87 87
            end
88 88

  
lib/redmine/pagination.rb
25 25
      def initialize(*args)
26 26
        if args.first.is_a?(ActionController::Base)
27 27
          args.shift
28
          ActiveSupport::Deprecation.warn "Paginator no longer takes a controller instance as the first argument. Remove it from #new arguments."
28
          Rails.application.deprecators[:redmine].warn "Paginator no longer takes a controller instance as the first argument. Remove it from #new arguments."
29 29
        end
30 30
        item_count, per_page, page, page_param = *args
31 31

  
......
95 95
      end
96 96

  
97 97
      def items_per_page
98
        ActiveSupport::Deprecation.warn "Paginator#items_per_page will be removed. Use #per_page instead."
98
        Rails.application.deprecators[:redmine].warn "Paginator#items_per_page will be removed. Use #per_page instead."
99 99
        per_page
100 100
      end
101 101

  
102 102
      def current
103
        ActiveSupport::Deprecation.warn "Paginator#current will be removed. Use .offset instead of .current.offset."
103
        Rails.application.deprecators[:redmine].warn "Paginator#current will be removed. Use .offset instead of .current.offset."
104 104
        self
105 105
      end
106 106
    end
(10-10/13)