Skip to content

Commit

Permalink
Prefer tap to ensure in this case, as we don't want assignment to hap…
Browse files Browse the repository at this point in the history
…pen when error is raised
  • Loading branch information
ianwhite committed Feb 9, 2009
1 parent ad0976d commit 62ab2b5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/inherit_views.rb
Expand Up @@ -130,9 +130,9 @@ def self.included(base)
base.class_eval do
# use InheritViews::PathSet, and give it my controller's inherit_view_paths
def view_paths=(value)
@view_paths = InheritViews::PathSet.new(value)
ensure
@view_paths.inherit_view_paths = controller.inherit_view_paths if (controller.inherit_views? rescue false)
@view_paths = InheritViews::PathSet.new(value).tap do |paths|
paths.inherit_view_paths = controller.inherit_view_paths if (controller.inherit_views? rescue false)
end
end

alias_method_chain :render, :parent
Expand Down

0 comments on commit 62ab2b5

Please sign in to comment.