Created
January 13, 2012 12:00
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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