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:
parent
aa6fbedc9e
commit
ccf06da461
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue