Sha256: 46b02fc6ec0054783860afadde523448321325c3d0ebcce96a8d0c5f8f48cd49

Contents?: true

Size: 859 Bytes

Versions: 39

Compression:

Stored size: 859 Bytes

Contents

require 'rails/generators/migration'
 
module TkhAdminPanel
  module Generators
    class CreateOrUpdateMigrationsGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path('../templates', __FILE__)
      desc "create or update setting 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
        puts 'creating or updating setting migrations'
        migration_template "create_settings.rb", "db/migrate/create_settings.rb"
        migration_template "add_contact_email_to_settings.rb", "db/migrate/add_contact_email_to_settings.rb"
      end
 
    end
  end
end

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
tkh_admin_panel-0.9.27 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.26 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.25 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.24 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.23 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.22 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.21 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.20 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.19 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.18 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.17 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.16 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.15 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.14 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.13 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.12 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.11 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.10 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.9 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb
tkh_admin_panel-0.9.8 lib/generators/tkh_admin_panel/create_or_update_migrations/create_or_update_migrations_generator.rb