summaryrefslogtreecommitdiffstats
path: root/config/initializers
diff options
context:
space:
mode:
Diffstat (limited to 'config/initializers')
-rw-r--r--config/initializers/10-patches.rb34
-rw-r--r--config/initializers/20-mime_types.rb3
-rw-r--r--config/initializers/30-redmine.rb2
3 files changed, 19 insertions, 20 deletions
diff --git a/config/initializers/10-patches.rb b/config/initializers/10-patches.rb
index 959107048..484ea1fb7 100644
--- a/config/initializers/10-patches.rb
+++ b/config/initializers/10-patches.rb
@@ -8,6 +8,9 @@ require 'active_record'
module ActiveRecord
class Base
include Redmine::I18n
+ def self.named_scope(*args)
+ scope(*args)
+ end
# Translate attribute names for validation errors display
def self.human_attribute_name(attr, *args)
@@ -35,6 +38,18 @@ module ActionView
end
end
end
+
+ class Resolver
+ def find_all(name, prefix=nil, partial=false, details={}, key=nil, locals=[])
+ cached(key, [name, prefix, partial], details, locals) do
+ if details[:formats] & [:xml, :json]
+ details = details.dup
+ details[:formats] = details[:formats].dup + [:api]
+ end
+ find_templates(name, prefix, partial, details)
+ end
+ end
+ end
end
ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "#{html_tag}" }
@@ -60,26 +75,9 @@ end
ActionMailer::Base.send :include, AsynchronousMailer
-module TMail
- # TMail::Unquoter.convert_to_with_fallback_on_iso_8859_1 introduced in TMail 1.2.7
- # triggers a test failure in test_add_issue_with_japanese_keywords(MailHandlerTest)
- class Unquoter
- class << self
- alias_method :convert_to, :convert_to_without_fallback_on_iso_8859_1
- end
- end
-
- # Patch for TMail 1.2.7. See http://www.redmine.org/issues/8751
- class Encoder
- def puts_meta(str)
- add_text str
- end
- end
-end
-
module ActionController
module MimeResponds
- class Responder
+ class Collector
def api(&block)
any(:xml, :json, &block)
end
diff --git a/config/initializers/20-mime_types.rb b/config/initializers/20-mime_types.rb
index dabac3463..cfd35a3e9 100644
--- a/config/initializers/20-mime_types.rb
+++ b/config/initializers/20-mime_types.rb
@@ -1,5 +1,4 @@
# Add new mime types for use in respond_to blocks:
Mime::SET << Mime::CSV unless Mime::SET.include?(Mime::CSV)
-Mime::Type.register 'application/pdf', :pdf
-Mime::Type.register 'image/png', :png
+
diff --git a/config/initializers/30-redmine.rb b/config/initializers/30-redmine.rb
index 708dcd655..4286081db 100644
--- a/config/initializers/30-redmine.rb
+++ b/config/initializers/30-redmine.rb
@@ -3,3 +3,5 @@ I18n.default_locale = 'en'
I18n::Backend::Simple.send(:include, I18n::Backend::Fallbacks)
require 'redmine'
+
+Redmine::Plugin.load