Skip to content

Commit

Permalink
Fix NoMethodError for ActiveRecord 7.1.2 in ShortenerGenerator
Browse files Browse the repository at this point in the history
Fixes error: 

`method_missing': undefined method `timestamped_migrations' for ActiveRecord::Base:Class (NoMethodError)
	from ~/.rvm/gems/ruby-3.2.2@maitre-d/gems/shortener-1.0.1/lib/generators/shortener/shortener_generator.rb:12:in `next_migration_number'
  • Loading branch information
jonathandean authored Jan 22, 2024
1 parent d23f458 commit 0989cbf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/generators/shortener/shortener_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def self.source_root
end

def self.next_migration_number(dirname)
if ActiveRecord::Base.timestamped_migrations
if ActiveRecord.timestamped_migrations
Time.new.utc.strftime("%Y%m%d%H%M%S")
else
"%.3d" % (current_migration_number(dirname) + 1)
Expand Down

0 comments on commit 0989cbf

Please sign in to comment.