Sha256: a7e2b4f4d47f80eabca8595e221f6aee73d7cb4ba826dc19bbae89ab2995195c

Contents?: true

Size: 636 Bytes

Versions: 6

Compression:

Stored size: 636 Bytes

Contents

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

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

    desc "Generates migration for read_markers"
    source_root File.expand_path('../templates', __FILE__)

    def create_migration_file
      migration_template 'migration.rb', 'db/migrate/unread_migration'
    end

    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
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
unread-mongoid-0.1.0 lib/generators/unread/migration/migration_generator.rb
unread-mongoid-0.0.5 lib/generators/unread/migration/migration_generator.rb
unread-mongoid-0.0.4 lib/generators/unread/migration/migration_generator.rb
unread-mongoid-0.0.3 lib/generators/unread/migration/migration_generator.rb
unread-mongoid-0.0.2 lib/generators/unread/migration/migration_generator.rb
unread-mongoid-0.0.1 lib/generators/unread/migration/migration_generator.rb