Sha256: 3d3a341f2f917d98222eb2969d7cc62d8d1e87a7dcb629369c367fa3103f8e98

Contents?: true

Size: 716 Bytes

Versions: 11

Compression:

Stored size: 716 Bytes

Contents

require 'rails/generators/migration'

module Apicasso
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration
      source_root File.expand_path('../templates', __FILE__)
      desc 'Add the required migrations to run APIcasso'

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

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
apicasso-0.4.11 lib/generators/apicasso/install/install_generator.rb
apicasso-0.4.10 lib/generators/apicasso/install/install_generator.rb
apicasso-0.4.9 lib/generators/apicasso/install/install_generator.rb
apicasso-0.4.8 lib/generators/apicasso/install/install_generator.rb
apicasso-0.4.7 lib/generators/apicasso/install/install_generator.rb
apicasso-0.4.6 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.16 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.15 lib/generators/apicasso/install/install_generator.rb
apicasso-0.1.5 lib/generators/apicasso/install/install_generator.rb
apicasso-0.1.4 lib/generators/apicasso/install/install_generator.rb
apicasso-0.1.3 lib/generators/apicasso/install/install_generator.rb