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