Sha256: 7d88060ba8f9db6f7aa7b3065655316f63d191c296741e8dd8745bd0a66865c4

Contents?: true

Size: 588 Bytes

Versions: 2

Compression:

Stored size: 588 Bytes

Contents

require 'rails/generators'
module LeadsToHighrise
	module Generators
		class InstallGenerator < ::Rails::Generators::Base
			source_root File.expand_path('../templates', __FILE__)
			def copy_migration
				copy_file "migrations/create_leads.rb", "db/migrate/#{time}_create_leads.rb"
				copy_file "migrations/add_highrise_site_and_highrise_user_to_user.rb", "db/migrate/#{time}_add_highrise_site_and_highrise_user_to_user.rb"
			end

			def time
				unless @time
					@time = DateTime.now.strftime("%Y%m%d%H%M%S").to_i
				else
					@time += 1
				end
				@time.to_s
			end
		end
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
leads_to_highrise-0.3.19 lib/generators/leads_to_highrise/install_generator.rb
leads_to_highrise-0.3.18 lib/generators/leads_to_highrise/install_generator.rb