module ActiveModel
  class Railtie < Rails::Railtie
    initializer 'generators' do |app|
      require 'rails/generators'
      require 'active_model/serializer/generators/serializer/serializer_generator'
      require 'active_model/serializer/generators/serializer/scaffold_controller_generator'
      Rails::Generators.configure!(app.config.generators)
      require 'active_model/serializer/generators/resource_override'
    end
  end
end

module ActiveModel
  class Railtie < Rails::Railtie
    initializer 'generators' do |app|
      app.load_generators
      require 'active_model/serializer/generators/serializer/serializer_generator'
      require 'active_model/serializer/generators/serializer/scaffold_controller_generator'
      require 'active_model/serializer/generators/resource_override'
    end
  end
end

Make sure generator hooks get run
Make sure generator hooks get run

Use Rails::Engine#load_generators instead of require +
Rails::Generators::configure!.
