Best practice for building migration generator

I often see different ways how migration generators are implemented
and I wonder what the recommended one at the moment is.

Currently I directly call:

ActiveRecord::Generators::Base.next_migration_number(path)

But it seems that this method is now depreciated (http://apidock.com/
rails/ActiveRecord/Generators/Base/next_migration_number/class) even
if it was just introduced as class method (https://
rails.lighthouseapp.com/projects/8994/tickets/3820-make-
railsgeneratorsmigrationnext_migration_number-method-a-class-method-so-
it-possible-to-use-it-in-custom-generators).

Is it now recommended to build the migration number manually again
(like here
https://github.com/codegram/resort/blob/master/lib/generators/active_record/resort_generator.rb)?

For my full generator please see (also see for the full generator
https://github.com/medihack/make_voteable/blob/master/lib/generators/make_voteable/make_voteable_generator.rb)

Best regards,
Kai

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs