Skip to content

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

Closed
Ladislav Gallay (Laykou) wants to merge 1 commit into
citusdata:masterfrom
Laykou:patch-2
Closed

Fix SystemStackError in schema_dumper.rb in combination with strong_migrations#257
Ladislav Gallay (Laykou) wants to merge 1 commit into
citusdata:masterfrom
Laykou:patch-2

Conversation

@Laykou

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

Gokhan Gulbiz (@gokhangulbiz) Could this be reviewed and merged, please?

@Laykou

Copy link
Copy Markdown
Contributor Author

Closing in favor of #245 245

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