Skip to content
New issue

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

Fix SystemStackError in schema_dumper.rb in combination with strong_migrations #257

Closed
wants to merge 1 commit into from

Conversation

Laykou
Copy link
Contributor

@Laykou Laykou commented Aug 29, 2024

When using https://github.com/ankane/strong_migrations gem, it also overrides the SchemaDumper.

Reference:
https://github.com/Laykou/strong_migrations/blob/master/lib/strong_migrations/schema_dumper.rb

strong_migrations in combination with this gem created following issue:

SystemStackError: stack level too deep (SystemStackError)
.../gems/strong_migrations-1.8.0/lib/strong_migrations/schema_dumper.rb:6:in `new'
.../gems/strong_migrations-1.8.0/lib/strong_migrations/schema_dumper.rb:6:in `initialize'
.../gems/activerecord-multi-tenant-2.4.0/lib/activerecord-multi-tenant/migrations.rb:93:in `initialize'
.../gems/strong_migrations-1.8.0/lib/strong_migrations/schema_dumper.rb:6:in `initialize'
.../gems/activerecord-multi-tenant-2.4.0/lib/activerecord-multi-tenant/migrations.rb:93:in `initialize'
.../gems/strong_migrations-1.8.0/lib/strong_migrations/schema_dumper.rb:6:in `initialize'

Module#prepend is recommended approach to be used here instead of monkey patching as advised here ankane/strong_migrations#270 (comment)

…igrations

When using https://github.com/ankane/strong_migrations gem, it also overrides the SchemaDumper. 

Reference:
https://github.com/Laykou/strong_migrations/blob/master/lib/strong_migrations/schema_dumper.rb

strong_migrations in combination with this gem created following issue:

```
SystemStackError: stack level too deep (SystemStackError)
.../gems/strong_migrations-1.8.0/lib/strong_migrations/schema_dumper.rb:6:in `new'
.../gems/strong_migrations-1.8.0/lib/strong_migrations/schema_dumper.rb:6:in `initialize'
.../gems/activerecord-multi-tenant-2.4.0/lib/activerecord-multi-tenant/migrations.rb:93:in `initialize'
.../gems/strong_migrations-1.8.0/lib/strong_migrations/schema_dumper.rb:6:in `initialize'
.../gems/activerecord-multi-tenant-2.4.0/lib/activerecord-multi-tenant/migrations.rb:93:in `initialize'
.../gems/strong_migrations-1.8.0/lib/strong_migrations/schema_dumper.rb:6:in `initialize'
```

`Module#prepend` is recommended approach to be used here instead of monkey patching as advised here ankane/strong_migrations#270 (comment)
@Laykou
Copy link
Contributor Author

Laykou commented Sep 4, 2024

@gokhangulbiz Could this be reviewed and merged, please?

@Laykou
Copy link
Contributor Author

Laykou commented Sep 14, 2024

Closing in favor of #245 245

@Laykou Laykou closed this Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant