Sha256: 5511ad4affb223bb120109e2c5d2a21d056d7a0f1da460263d2b2eff93a2e8af

Contents?: true

Size: 694 Bytes

Versions: 8

Compression:

Stored size: 694 Bytes

Contents

require 'rails'

module OfacMigration
	module Generators
		class BuildGenerator < ::Rails::Generators::Base
			include Rails::Generators::Migration
			source_root File.expand_path('../templates', __FILE__)
			desc "Adds the migration for the ofac_sdns table."
			
			# Get the next migration number
			#
			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
			
			# copy the migration file over
			#
			def copy_migrations
				migration_template "create_ofac_sdns.rb", "db/migrate/create_ofac_sdns.rb"
			end
			
		end
	end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ofac-2.0.4 lib/generators/ofac_migration/build/build_generator.rb
ofac-2.0.3 lib/generators/ofac_migration/build/build_generator.rb
ofac-2.0.2 lib/generators/ofac_migration/build/build_generator.rb
ofac-2.0.1 lib/generators/ofac_migration/build/build_generator.rb
ofac-2.0.0 lib/generators/ofac_migration/build/build_generator.rb
ofac-1.3.2 lib/generators/ofac_migration/build/build_generator.rb
ofac-1.3.1 lib/generators/ofac_migration/build/build_generator.rb
ofac-1.3.0 lib/generators/ofac_migration/build/build_generator.rb