Skip to content

Commit 53ee93d

Browse files
moviendomeclaude
andcommitted
Fix install generator for Rails 8.1 compatibility
ActiveRecord::Generators::Base no longer exists in Rails 8.1. Use Time.now.utc.strftime for timestamped migration numbers directly. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 91e2c83 commit 53ee93d

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

lib/generators/solrengine/auth/install_generator.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ class InstallGenerator < Rails::Generators::Base
1111
source_root File.expand_path("templates", __dir__)
1212

1313
def self.next_migration_number(dirname)
14-
ActiveRecord::Generators::Base.next_migration_number(dirname)
14+
if ActiveRecord.respond_to?(:timestamped_migrations) && ActiveRecord.timestamped_migrations
15+
Time.now.utc.strftime("%Y%m%d%H%M%S")
16+
else
17+
"%.3d" % (current_migration_number(dirname) + 1)
18+
end
1519
end
1620

1721
def create_initializer

0 commit comments

Comments
 (0)