Skip to content

Instantly share code, notes, and snippets.

@gregoriokusowski
Created January 13, 2012 12:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gregoriokusowski/1605765 to your computer and use it in GitHub Desktop.
Save gregoriokusowski/1605765 to your computer and use it in GitHub Desktop.
Checks for all non-tenant models inside an app/models folder. Easy to run via rails console.
tenant_model_class = TenantModel
%x[ls app/models/].split("\n").each do |w|
begin
model = w[0...-3].camelize.constantize
k = model
while k != Object
if k == ActiveRecord::Base
unless model.include? tenant_model_class
puts model
end
end
k = k.superclass
end
rescue
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment