1
0
Fork 0
mirror of https://github.com/paper-trail-gem/paper_trail.git synced 2022-11-09 11:33:19 -05:00

Leveraging ActiveRecord::Generators::Base class for implementation of the :next_migration_number class method on the InstallGenerator

This commit is contained in:
Ben Atkins 2013-08-19 12:02:11 -04:00
parent aa6fbedc9e
commit ccf06da461

View file

@ -1,5 +1,6 @@
require 'rails/generators' require 'rails/generators'
require 'rails/generators/migration' require 'rails/generators/migration'
require 'rails/generators/active_record'
module PaperTrail module PaperTrail
class InstallGenerator < ::Rails::Generators::Base class InstallGenerator < ::Rails::Generators::Base
@ -16,8 +17,7 @@ module PaperTrail
end end
def self.next_migration_number(dirname) def self.next_migration_number(dirname)
next_migration_number = current_migration_number(dirname) + 1 ActiveRecord::Generators::Base.next_migration_number(dirname)
ActiveRecord::Migration.next_migration_number(next_migration_number)
end end
end end
end end