Permalink
Browse files

adding tests

  • Loading branch information...
1 parent a3bae98 commit c095954b0955c7607cf752ae7c6e51d8150ea841 Ben VandenBos committed Sep 24, 2008
Showing with 8 additions and 9 deletions.
  1. +8 −9 lib/render_partial_comments.rb
@@ -7,19 +7,18 @@ class ActionView::Base
$render_partial_comments ||= false
- # don't even define this method if we don't want it enabled (that way there is no
- # overhead in non-development environments
- if $render_partial_comments
-
- # render_partial(partial_path, object_assigns = nil, local_assigns = {})
- def render_partial_with_comments(partial_path, object_assigns = nil, local_assigns = {})
+ # render_partial(partial_path, object_assigns = nil, local_assigns = {})
+ def render_partial_with_comments(partial_path, object_assigns = nil, local_assigns = {})
+ if $render_partial_comments
r = %{<!-- render_begin '#{partial_path}' -->}
r << render_partial_without_comments(partial_path, object_assigns, local_assigns)
r << %{<!-- render_end '#{partial_path}' -->}
r
+ else
+ render_partial_without_comments(partial_path, object_assigns, local_assigns)
end
-
- alias_method_chain :render_partial, :comments
-
end
+
+ alias_method :render_partial_without_comments, :render_partial
+ alias_method :render_partial, :render_partial_with_comments
end

0 comments on commit c095954

Please sign in to comment.