Feature #29914 » 32886-wip-r19467.patch
Gemfile | ||
---|---|---|
3 | 3 |
ruby '>= 2.3.0', '< 2.7.0' if Bundler::VERSION >= '1.12.0' |
4 | 4 |
gem "bundler", ">= 1.5.0" |
5 | 5 | |
6 |
gem "rails", "5.2.4.1"
|
|
6 |
gem 'rails', '6.0.2.1'
|
|
7 | 7 |
gem 'sprockets', '~> 3.7.2' if RUBY_VERSION < '2.5' |
8 | 8 |
gem 'rouge', '~> 3.15.0' |
9 | 9 |
gem 'request_store', '~> 1.5.0' |
config/initializers/10-patches.rb | ||
---|---|---|
53 | 53 | |
54 | 54 |
class Resolver |
55 | 55 |
def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[]) |
56 |
locals = locals.map(&:to_s).sort!.freeze |
|
56 | 57 |
cached(key, [name, prefix, partial], details, locals) do |
57 | 58 |
if (details[:formats] & [:xml, :json]).any? |
58 | 59 |
details = details.dup |
59 | 60 |
details[:formats] = details[:formats].dup + [:api] |
60 | 61 |
end |
61 |
find_templates(name, prefix, partial, details)
|
|
62 |
_find_all(name, prefix, partial, details, key, locals)
|
|
62 | 63 |
end |
63 | 64 |
end |
64 | 65 |
end |
lib/redmine/views/api_template_handler.rb | ||
---|---|---|
20 | 20 |
module Redmine |
21 | 21 |
module Views |
22 | 22 |
class ApiTemplateHandler |
23 |
def self.call(template) |
|
24 |
"Redmine::Views::Builders.for(params[:format], request, response) do |api|; #{template.source}; self.output_buffer = api.output; end"
|
|
23 |
def self.call(template, source)
|
|
24 |
"Redmine::Views::Builders.for(params[:format], request, response) do |api|; #{source}; self.output_buffer = api.output; end" |
|
25 | 25 |
end |
26 | 26 |
end |
27 | 27 |
end |