Sha256: eb587ad842aa0a08b07cef611e76c28d11503598d190a0f3a60ddde43b7f35fb

Contents?: true

Size: 547 Bytes

Versions: 4

Compression:

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

4 entries across 4 versions & 1 rubygems

Version Path
attachs-4.0.0.5 lib/generators/attachs/upload/upload_generator.rb
attachs-4.0.0.4 lib/generators/attachs/upload/upload_generator.rb
attachs-4.0.0.3 lib/generators/attachs/upload/upload_generator.rb
attachs-4.0.0.2 lib/generators/attachs/upload/upload_generator.rb