Class: Paypal::Generators::IpnMessageGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
Rails::Generators::Migration
Defined in:
lib/generators/paypal/ipn_message_generator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



18
19
20
# File 'lib/generators/paypal/ipn_message_generator.rb', line 18

def self.next_migration_number(path)
    Time.now.utc.strftime("%Y%m%d%H%M%S")
end

Instance Method Details

#add_routeObject



26
27
28
# File 'lib/generators/paypal/ipn_message_generator.rb', line 26

def add_route
	route %Q{match "ipn_message", :to => "callback_controller#handle_ipn", :as => :ipn_message} if FileTest.exists?("config/routes.rb")
end

#add_to_ipn_message_handling_modelObject



22
23
24
# File 'lib/generators/paypal/ipn_message_generator.rb', line 22

def add_to_ipn_message_handling_model
	copy_file "ipn_message.rb", "app/models/ipn_message.rb"
end

#create_ipn_message_migrationObject



14
15
16
# File 'lib/generators/paypal/ipn_message_generator.rb', line 14

def create_ipn_message_migration
	migration_template "migration.rb", "db/migrate/add_ipn_messages.rb"
end