You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's been a long time since any update from this gem
And some internal/API/whatever changes in active record is making this gem unusable
I am here to share some monkey patches so you can use this gem with new rails versions
Rails 7.1
I use sane_patch to ensure I got error when this gem is updated
You can remove it entirely
# config/initializers/lazy_migrate_monkey_patches.rbrequire"lazy_migrate"SanePatch.patch("lazy_migrate","0.3.0")do# Compatibility for rails 7moduleLazyMigrate# rubocop:disable Style/StaticClassclassClientclass << selfdefrunmigrator_adapter=MigratorAdapterFactory.create_migrator_adapterloopdocatch(:done)doon_done=->{throw(:done)}database_name=ifActiveRecord::Base.respond_to?(:connection_db_config)# Rails 7ActiveRecord::Base.connection_db_config.databaseelse# Rails 6-ActiveRecord::Base.connection_config[:database]endprompt.ok("\nDatabase: #{database_name}\n")select_migration_prompt(on_done: on_done,migrator_adapter: migrator_adapter)endendrescueTTY::Reader::InputInterruptputsendendendclassMigratorAdapter# From 0.3.0defdump_schemareturnif !ActiveRecord.dump_schema_after_migration# ripped from https://github.com/rails/rails/blob/5-1-stable/activerecord/lib/active_record/railties/databases.rakefilename=ENV["SCHEMA"] || File.join(ActiveRecord::Tasks::DatabaseTasks.db_dir,"schema.rb")File.open(filename,"w:utf-8")do |file|
ActiveRecord::SchemaDumper.dump(ActiveRecord::Base.connection,file)endendend# rubocop:enable Style/StaticClassendend
The text was updated successfully, but these errors were encountered:
It's been a long time since any update from this gem
And some internal/API/whatever changes in active record is making this gem unusable
I am here to share some monkey patches so you can use this gem with new rails versions
Rails 7.1
I use
sane_patch
to ensure I got error when this gem is updatedYou can remove it entirely
The text was updated successfully, but these errors were encountered: