Skip to content

Commit

Permalink
Support Rails 7.1
Browse files Browse the repository at this point in the history
  • Loading branch information
javierav authored and huacnlee committed Oct 3, 2023
1 parent 815126f commit 71c25dd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/generators/settings/install_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,16 @@ class InstallGenerator < Rails::Generators::NamedBase

@@migrations = false

def self.timestamped_migrations
if ActiveRecord::Base.respond_to?(:timestamped_migrations)
ActiveRecord::Base.timestamped_migrations
elsif ActiveRecord.respond_to?(:timestamped_migrations)
ActiveRecord.timestamped_migrations
end
end

def self.next_migration_number(dirname) #:nodoc:
if ActiveRecord::Base.timestamped_migrations
if timestamped_migrations
if @@migrations
(current_migration_number(dirname) + 1)
else
Expand Down

0 comments on commit 71c25dd

Please sign in to comment.