We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typesense shouldn't affect logging from migrate tasks / specs
rbenv local 2.7.2 rails _5.1.7_ new foo cd foo rails g model Bar rails db:migrate
== 20220331123536 CreateBars: migrating ======================================= -- create_table(:bars) -> 0.0003s == 20220331123536 CreateBars: migrated (0.0003s) ==============================
Then
rails db:drop echo "gem 'typesense-rails', git: 'https://github.com/typesense/typesense-rails.git', branch: 'adaptation'" >> Gemfile bundle install rails db:migrate
(0.0ms) SELECT sqlite_version(*) (1.0ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY) (0.5ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC Migrating to CreateBars (20220331123536) (0.0ms) begin transaction == 20220331123536 CreateBars: migrating ======================================= -- create_table(:bars) (0.2ms) CREATE TABLE "bars" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) -> 0.0003s == 20220331123536 CreateBars: migrated (0.0003s) ============================== SQL (0.0ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20220331123536"]] (0.3ms) commit transaction ActiveRecord::InternalMetadata Load (0.0ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]] (0.0ms) begin transaction SQL (0.1ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", "2022-03-31 12:42:21.424311"], ["updated_at", "2022-03-31 12:42:21.424311"]] (0.2ms) commit transaction (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
I think this should be done in the railtie / engine rather than top level of the file.
This also changes the logging setting when running specs.
https://github.com/typesense/typesense-rails/blob/adaptation/lib/typesense-rails.rb#L20-L22
Edit: Some further investigation shows that we were getting the logger defined in
https://github.com/rails/rails/blob/5-1-stable/railties/lib/rails/application/bootstrap.rb#L33
We are currently handling this by changing config/environment.rb to unset loggers set before the application is initialized
config/environment.rb
require_relative 'application' Rails.logger = nil Rails.application.initialize!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Typesense shouldn't affect logging from migrate tasks / specs
Steps To Reproduce
Output of migrate
Then
Output of migrate
I think this should be done in the railtie / engine rather than top level of the file.
This also changes the logging setting when running specs.
https://github.com/typesense/typesense-rails/blob/adaptation/lib/typesense-rails.rb#L20-L22
Edit: Some further investigation shows that we were getting the logger defined in
https://github.com/rails/rails/blob/5-1-stable/railties/lib/rails/application/bootstrap.rb#L33
We are currently handling this by changing
config/environment.rb
to unset loggers set before the application is initializedThe text was updated successfully, but these errors were encountered: