Sha256: 518a63d6022c09687617cebfe019dc2457f72f46b3a24ad0c88d53cc47625f4a

Contents?: true

Size: 549 Bytes

Versions: 2

Compression:

Stored size: 549 Bytes

Contents

require 'rails/generators'

module Attachs
  module Generators
    class UploadGenerator < ::Rails::Generators::Base
      include Rails::Generators::Migration

      source_root File.expand_path('../templates', __FILE__)

      def create_model_file
        copy_file 'model.rb', 'app/models/upload.rb'
      end

      def create_migration_file
        migration_template 'migration.rb', 'db/migrate/create_uploads.rb'
      end

      def self.next_migration_number(path)
        Time.now.utc.strftime '%Y%m%d%H%M%S'
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
attachs-4.0.0.1 lib/generators/attachs/upload/upload_generator.rb
attachs-4.0.0.0 lib/generators/attachs/upload/upload_generator.rb