Sha256: 057fc06347856668fdc0ab7594f11c104b0b0ce880792cfca68d741ac653edf3
Contents?: true
Size: 1018 Bytes
Versions: 1
Compression:
Stored size: 1018 Bytes
Contents
require 'rails/generators/migration' module TkhContent module Generators class CreateOrUpdateMigrationsGenerator < ::Rails::Generators::Base include Rails::Generators::Migration source_root File.expand_path('../templates', __FILE__) desc "create or update page 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 puts 'creating or updating page migrations' migration_template "create_pages.rb", "db/migrate/create_pages.rb" migration_template "add_author_to_pages.rb", "db/migrate/add_author_to_pages.rb" migration_template "add_parent_id_to_pages.rb", "db/migrate/add_parent_id_to_pages.rb" migration_template "add_short_title_to_pages.rb", "db/migrate/add_short_title_to_pages.rb" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tkh_content-0.1.1 | lib/generators/tkh_content/create_or_update_migrations/create_or_update_migrations_generator.rb |