Class: LeadsToHighrise::Generators::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/leads_to_highrise/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_migrationObject



6
7
8
9
# File 'lib/generators/leads_to_highrise/install_generator.rb', line 6

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

#timeObject



11
12
13
14
15
16
17
18
# File 'lib/generators/leads_to_highrise/install_generator.rb', line 11

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