Sha256: fbec4dc33597edefc33cf2634a6acf59910b421e21437b8a3c9b36914e7029ba

Contents?: true

Size: 785 Bytes

Versions: 10

Compression:

Stored size: 785 Bytes

Contents

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

module ActsAsMessageable
  class MigrationGenerator < Rails::Generators::Base
    include Rails::Generators::Migration

    namespace "acts-as-messageable:migration"

    source_root File.join(File.dirname(__FILE__), 'templates')
    argument :table_name, :type => :string, :default => "messages"

    def self.next_migration_number(dirname)
      ActiveRecord::Generators::Base.next_migration_number(dirname)
    end

    def create_migration_file
      migration_template 'migration.rb', 'db/migrate/create_messages_table.rb' rescue nil
      migration_template 'migration_permanent.rb', 'db/migrate/add_recipient_permanent_delete_and_sender_permanent_delete_to_messages.rb' rescue nil
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
acts-as-messageable-0.4.10 lib/generators/acts-as-messageable/migration/migration_generator.rb
acts-as-messageable-0.4.9 lib/generators/acts-as-messageable/migration/migration_generator.rb
acts-as-messageable-0.4.8 lib/generators/acts-as-messageable/migration/migration_generator.rb
acts-as-messageable-0.4.7 lib/generators/acts-as-messageable/migration/migration_generator.rb
acts-as-messageable-0.4.6 lib/generators/acts-as-messageable/migration/migration_generator.rb
acts-as-messageable-0.4.5 lib/generators/acts-as-messageable/migration/migration_generator.rb
acts-as-messageable-0.4.4 lib/generators/acts-as-messageable/migration/migration_generator.rb
acts-as-messageable-0.4.3 lib/generators/acts-as-messageable/migration/migration_generator.rb
acts-as-messageable-0.4.2 lib/generators/acts-as-messageable/migration/migration_generator.rb
acts-as-messageable-0.4.1 lib/generators/acts-as-messageable/migration/migration_generator.rb