Fixed that MissingSourceFile's wasn't properly detected in production mode #925 [Nicholas Seckar]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@990 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 a5c69428
......@@ -82,14 +82,6 @@ def require_dependencies(layer, dependencies)
def inherited(child)
inherited_without_model(child)
return if child.controller_name == "application" # otherwise the ApplicationController in Rails will include itself
model_name = child.controller_name.singularize
begin
require_dependency model_name
child.model model_name
rescue MissingSourceFile => e
raise unless e.path == model_name + '.rb'
end
end
end
end
......
......@@ -93,7 +93,7 @@ def inherited(child)
inherited_without_helper(child)
begin child.helper(child.controller_path)
rescue MissingSourceFile => e
raise unless e.path == "helpers/#{child.controller_path}_helper.rb"
raise unless e.is_missing?("helpers/#{child.controller_path}_helper")
end
end
end
......
......@@ -86,7 +86,7 @@ def inherited(child)
inherited_without_api(child)
begin child.web_service_api(child.controller_path)
rescue MissingSourceFile => e
raise unless e.path == "apis/#{child.controller_path}_api.rb"
raise unless e.is_missing?("apis/#{child.controller_path}_api")
end
end
end
......
*SVN*
* Fixed that MissingSourceFile's wasn't properly detected in production mode #925 [Nicholas Seckar]
* Fixed that :counter_cache option would look for a line_items_count column for a LineItem object instead of lineitems_count
* Fixed that AR exists?() would explode on postgresql if the passed id did not match the PK type #900 [Scott Barron]
......
......@@ -5,6 +5,10 @@ def initialize(message, path)
@path = path
end
def is_missing?(path)
path.gsub(/\.rb$/, '') == self.path.gsub(/\.rb$/, '')
end
def self.from_message(message)
REGEXPS.each do |regexp, capture|
match = regexp.match(message)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册