Sha256: 33d778f6f6b94b85c9b23d1002a367a02e9f6a22f95c5d79235bf4b59b096e25

Contents?: true

Size: 729 Bytes

Versions: 5

Compression:

Stored size: 729 Bytes

Contents

require 'rails/generators/migration'

module BulutfonDashboard
  module Generators
    class MigrationsGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path('../../templates/migrations', __FILE__)
      desc 'add the migrations'

      def self.next_migration_number(path)
        unless @prev_migration_nr
          @prev_migration_nr = Time.now.utc.strftime('%Y%m%d%H%M%S').to_i
        else
          @prev_migration_nr += 1
        end
        @prev_migration_nr.to_s
      end

      def copy_migrations
        migration_template 'create_bulutfon_dashboard_bulutfon_users.rb', 'db/migrate/create_bulutfon_dashboard_bulutfon_users.rb'
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bulutfon_dashboard-0.7.4 lib/generators/bulutfon_dashboard/migrations_generator.rb
bulutfon_dashboard-0.7.3 lib/generators/bulutfon_dashboard/migrations_generator.rb
bulutfon_dashboard-0.7.2 lib/generators/bulutfon_dashboard/migrations_generator.rb
bulutfon_dashboard-0.7.1 lib/generators/bulutfon_dashboard/migrations_generator.rb
bulutfon_dashboard-0.7.0 lib/generators/bulutfon_dashboard/migrations_generator.rb