diff --git a/lib/rolify/configure.rb b/lib/rolify/configure.rb index 9647f9ca..0d714b21 100644 --- a/lib/rolify/configure.rb +++ b/lib/rolify/configure.rb @@ -45,7 +45,7 @@ def sanity_check(role_cnames) role_cnames = [ "Role" ] if role_cnames.empty? role_cnames.each do |role_cname| role_class = role_cname.constantize - if role_class.superclass.to_s == "ActiveRecord::Base" && !role_class.table_exists? + if role_class.connected? && role_class.superclass.to_s == "ActiveRecord::Base" && !role_class.table_exists? warn "[WARN] table '#{role_cname}' doesn't exist. Did you run the migration ? Ignoring rolify config." return false end @@ -53,4 +53,4 @@ def sanity_check(role_cnames) true end end -end \ No newline at end of file +end