public
Created

Find any ActiveRecords being passed into your views.

  • Download Gist
application_controller.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11 12 13
class ApplicationController < ActionController::Base
 
require 'test/unit/assertions'
include Test::Unit::Assertions
after_filter do
instance_variables.each do |variable|
assert !instance_variable_get(variable).is_a?(ActiveRecord::Base), "#{variable} is an ActiveRecord"
end
end
 
#...
 
end

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.