motor-admin / motor-admin-rails

Low-code Admin panel and Business intelligence Rails engine. No DSL - configurable from the UI. Rails Admin, Active Admin, Blazer modern alternative.
https://app.getmotoradmin.com/demo/
MIT License
752 stars 76 forks source link

Added persisted check for AR timestamped_migrations #147

Closed CandyFet closed 9 months ago

CandyFet commented 9 months ago

Resolve https://github.com/motor-admin/motor-admin-rails/issues/146

Igneous commented 9 months ago

Hey guys (@CandyFet && @omohokcoj ), thanks for the work on this. I haven't had a chance to test it yet, but I think I see a couple issues.

Two problems I think I see:

  1. Now we're checking whether or not activerecord can respond_to timestamped_migrations, rather than whether or not timestamped migrations are enabled.
  2. In rails 7.1 and above, timestamped_migrations exists in ActiveRecord.timestamped_migrations, not ActiveRecord::Base, so it'll always default to generating numbered migrations.

Am I imagining these problems, is this a proper fix?

omohokcoj commented 9 months ago

@Igneous good point, thanks - a proper fix has been added into master: https://github.com/motor-admin/motor-admin-rails/commit/00ae25daccac7439fb76a9fb4ac639f17519d9c5