Skip to content
Create a gist now

Instantly share code, notes, and snippets.

Find any ActiveRecords being passed into your views.
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"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.