Skip to content

Commit

Permalink
Getting rails view features to pass by extending ActionView::Base rat…
Browse files Browse the repository at this point in the history
…her than ActionView::Template
  • Loading branch information
josephwilk committed Apr 7, 2010
1 parent 4c97b45 commit e4c2b0d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/cucover/rails.rb
Expand Up @@ -5,14 +5,17 @@ def patch_if_necessary
return if @patched
return unless defined?(ActionView)

Monkey.extend_every ActionView::Template => Cucover::Rails::RecordsRenders
Monkey.extend_every ActionView::Base => Cucover::Rails::RecordsRenders
# Monkey.extend_every ActionView::Template => Cucover::Rails::RecordsRenders # TODO: patch nicer template

@patched = true
end
end

module RecordsRenders
def render
Cucover.record_file(@filename)
def render(*args)
filename = args[0][:file].filename
Cucover.record_file(filename)
super
end
end
Expand Down

0 comments on commit e4c2b0d

Please sign in to comment.