Module: Cucover::Rails

Defined in:
lib/cucover.rb

Defined Under Namespace

Modules: RecordsRenders

Class Method Summary collapse

Class Method Details

.patch_if_necessaryObject



121
122
123
124
125
126
127
128
129
130
131
132
# File 'lib/cucover.rb', line 121

def patch_if_necessary
  return if @patched
  return unless defined?(ActionView)
  
  ActionView::Template.instance_eval do
    def new(*args)
      super(*args).extend(Cucover::Rails::RecordsRenders)
    end
  end
  
  @patched = true
end