Sha256: f1a9caeaa36437190b681cb4d59bf7229743305a24610f754be600d5cbae541e

Contents?: true

Size: 714 Bytes

Versions: 4

Compression:

Stored size: 714 Bytes

Contents

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

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

    namespace "acts_as_chattable:migration"

    source_root File.join(File.dirname(__FILE__), 'templates')

    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

4 entries across 4 versions & 1 rubygems

Version Path
acts_as_chattable-0.0.4 lib/generators/acts_as_chattable/migration/migration_generator.rb
acts_as_chattable-0.0.3 lib/generators/acts_as_chattable/migration/migration_generator.rb
acts_as_chattable-0.0.2 lib/generators/acts_as_chattable/migration/migration_generator.rb
acts_as_chattable-0.0.1 lib/generators/acts_as_chattable/migration/migration_generator.rb