Sha256: 06a3508bfe7a02e2838ea64c72730535ecce83030ce377b4d11e3fa26fd11e89

Contents?: true

Size: 827 Bytes

Versions: 21

Compression:

Stored size: 827 Bytes

Contents

require 'rails/generators'
require 'rails/generators/migration'   
module Lolita
  module FileUpload
    module Generators
      class InstallGenerator < Rails::Generators::Base
        include Rails::Generators::Migration
        source_root File.expand_path("../templates", __FILE__)
        desc "Create migrations. "

        def self.next_migration_number(dirname)
         if ActiveRecord::Base.timestamped_migrations
           Time.now.utc.strftime("%Y%m%d%H%M%S")
         else
           "%.3d" % (current_migration_number(dirname) + 1)
         end
       end

        def create_menu_migrations
          begin
            migration_template "migration.rb", "db/migrate/create_lolita_upload_files.rb" 
          rescue Exception => e
            puts e
          end
        end
       
      end
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
lolita-file-upload-0.4.10 lib/generators/lolita/file_upload/install_generator.rb