mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Ruby 1.9 compat: anonymous class name is nil not '' now
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9185 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
parent
767be30e61
commit
2916686c95
1 changed files with 5 additions and 5 deletions
|
@ -22,7 +22,7 @@ module ActionMailer
|
||||||
|
|
||||||
module ClassMethods
|
module ClassMethods
|
||||||
# Makes all the (instance) methods in the helper module available to templates rendered through this controller.
|
# Makes all the (instance) methods in the helper module available to templates rendered through this controller.
|
||||||
# See ActionView::Helpers (link:classes/ActionView/Helpers.html) for more about making your own helper modules
|
# See ActionView::Helpers (link:classes/ActionView/Helpers.html) for more about making your own helper modules
|
||||||
# available to the templates.
|
# available to the templates.
|
||||||
def add_template_helper(helper_module) #:nodoc:
|
def add_template_helper(helper_module) #:nodoc:
|
||||||
master_helper_module.module_eval "include #{helper_module}"
|
master_helper_module.module_eval "include #{helper_module}"
|
||||||
|
@ -45,7 +45,7 @@ module ActionMailer
|
||||||
when String, Symbol
|
when String, Symbol
|
||||||
file_name = arg.to_s.underscore + '_helper'
|
file_name = arg.to_s.underscore + '_helper'
|
||||||
class_name = file_name.camelize
|
class_name = file_name.camelize
|
||||||
|
|
||||||
begin
|
begin
|
||||||
require_dependency(file_name)
|
require_dependency(file_name)
|
||||||
rescue LoadError => load_error
|
rescue LoadError => load_error
|
||||||
|
@ -87,17 +87,17 @@ module ActionMailer
|
||||||
attrs.flatten.each { |attr| helper_method(attr, "#{attr}=") }
|
attrs.flatten.each { |attr| helper_method(attr, "#{attr}=") }
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
def inherited_with_helper(child)
|
def inherited_with_helper(child)
|
||||||
inherited_without_helper(child)
|
inherited_without_helper(child)
|
||||||
begin
|
begin
|
||||||
child.master_helper_module = Module.new
|
child.master_helper_module = Module.new
|
||||||
child.master_helper_module.send! :include, master_helper_module
|
child.master_helper_module.send! :include, master_helper_module
|
||||||
child.helper child.name.underscore
|
child.helper child.name.to_s.underscore
|
||||||
rescue MissingSourceFile => e
|
rescue MissingSourceFile => e
|
||||||
raise unless e.is_missing?("helpers/#{child.name.underscore}_helper")
|
raise unless e.is_missing?("helpers/#{child.name.underscore}_helper")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in a new issue