Sha256: 440e58eb813edf3eeff6ff9701c4094375f9d2572f94170825578b00fe1dc17e

Contents?: true

Size: 715 Bytes

Versions: 6

Compression:

Stored size: 715 Bytes

Contents

require 'rails/generators'
require 'rails/generators/migration'

module RailsApiDoc
  class InstallGenerator < ::Rails::Generators::Base
    include Rails::Generators::Migration
    source_root File.expand_path('../templates', __FILE__)

    desc "add the migrations"
    def self.next_migration_number(path)
      Time.now.utc.strftime("%Y%m%d%H%M%S")
    end

    def copy_migrations
      filename = 'generate_rails_api_documentation_attributes_table'
      if self.class.migration_exists?('db/migrate', "#{filename}")
        say_status('skipped', "Migration #{filename}.rb already exists")
      else
        migration_template "api_datum_migration.rb", "db/migrate/#{filename}.rb"
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_api_documentation-0.3.4 lib/generators/rails_api_doc/install_generator.rb
rails_api_documentation-0.3.3 lib/generators/rails_api_doc/install_generator.rb
rails_api_documentation-0.3.2 lib/generators/rails_api_doc/install_generator.rb
rails_api_documentation-0.3.1 lib/generators/rails_api_doc/install_generator.rb
rails_api_documentation-0.3.0 lib/generators/rails_api_doc/install_generator.rb
rails_api_documentation-0.2.3 lib/generators/rails_api_doc/install_generator.rb