Sha256: b2940996a6889ab460b315f816900872ba9f7cc50afce863295f304937141907

Contents?: true

Size: 741 Bytes

Versions: 29

Compression:

Stored size: 741 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

29 entries across 29 versions & 1 rubygems

Version Path
apicasso-0.4.5 lib/generators/apicasso/install/install_generator.rb
apicasso-0.4.4 lib/generators/apicasso/install/install_generator.rb
apicasso-0.4.3 lib/generators/apicasso/install/install_generator.rb
apicasso-0.4.2 lib/generators/apicasso/install/install_generator.rb
apicasso-0.4.1 lib/generators/apicasso/install/install_generator.rb
apicasso-0.4.0 lib/generators/apicasso/install/install_generator.rb
apicasso-0.3.3 lib/generators/apicasso/install/install_generator.rb
apicasso-0.3.2 lib/generators/apicasso/install/install_generator.rb
apicasso-0.3.1 lib/generators/apicasso/install/install_generator.rb
apicasso-0.3.0 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.14 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.13 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.12 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.11 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.10 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.9 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.8 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.7 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.6 lib/generators/apicasso/install/install_generator.rb
apicasso-0.2.5 lib/generators/apicasso/install/install_generator.rb