I've written a multi-tenancy gem for Rails.
When I create a new tenant, I load in the schema.rb file. This works fine, except that each time I do it, I get a deluge of log messages:
-- create_table("users", {:force=>true})
NOTICE: CREATE TABLE will create implicit sequence "users_id_seq" for serial column "users.id"
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "users_pkey" for table "users"
-> 0.0102s
-- add_index("users", ["email"], {:name=>"index_users_on_email", :unique=>true})
-> 0.0035s
-- add_index("users", ["reset_password_token"], {:name=>"index_users_on_reset_password_token", :unique=>true})
-> 0.0040s
Etc etc... all typical of the loading the schema.rb
file. My problem is that it's rather annoying to see this during tests. I really don't care to see this and it muddies up my test output, making it much harder for me to debug and verify tests etc...
Does anyone know of a way I can silence this output? I've tried the following in my gem:
Rails.logger.silence{ load("#{Rails.root}/db/seeds.rb") }
but that doesn't change a thing. Does anyone know of a config option or some other way I can silence the output from schema loading?