summaryrefslogtreecommitdiffstats
path: root/config/initializers
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-25 17:17:49 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-04-25 17:17:49 +0000
commit5e57a1a9d9478162ac4f27ae96b2ccaf55a1aba7 (patch)
tree93e57765139714bd82dede475725516c448c0d55 /config/initializers
parent34e20c4373b7f5a20ab3a132feae3f70f21ec477 (diff)
downloadredmine-5e57a1a9d9478162ac4f27ae96b2ccaf55a1aba7.tar.gz
redmine-5e57a1a9d9478162ac4f27ae96b2ccaf55a1aba7.zip
Merged rails-3.2 branch.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9528 e93f8b46-1217-0410-a6f0-8f06a7374b81
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