Sha256: a671ac0708aad45d140ccc6b793c41f4a45344286f1f01634d1501579a0bc3ee

Contents?: true

Size: 636 Bytes

Versions: 6

Compression:

Stored size: 636 Bytes

Contents

module MailboxerMultiAttach
  class InstallGenerator < Rails::Generators::Base #:nodoc:
    include Rails::Generators::Migration
    source_root File.expand_path('../templates', __FILE__)
    require 'rails/generators/migration'

    desc "add the migrations"

    def self.next_migration_number path
      unless @prev_migration_nr
      @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
      else
      @prev_migration_nr += 1
      end
      @prev_migration_nr.to_s
    end

    def copy_migrations
      migration_template "create_message_attachments.rb", "db/migrate/create_message_attachments.rb"
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
mailboxer_multi_attach-0.0.6 lib/generators/mailboxer_multi_attach/install_generator.rb
mailboxer_multi_attach-0.0.5 lib/generators/mailboxer_multi_attach/install_generator.rb
mailboxer_multi_attach-0.0.4 lib/generators/mailboxer_multi_attach/install_generator.rb
mailboxer_multi_attach-0.0.3 lib/generators/mailboxer_multi_attach/install_generator.rb
mailboxer_multi_attach-0.0.2 lib/generators/mailboxer_multi_attach/install_generator.rb
mailboxer_multi_attach-0.0.1 lib/generators/mailboxer_multi_attach/install_generator.rb