Class: Paypal::Generators::IpnMessageGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Paypal::Generators::IpnMessageGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/paypal/ipn_message_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #add_route ⇒ Object
- #add_to_ipn_message_handling_model ⇒ Object
- #create_ipn_message_migration ⇒ Object
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_route ⇒ Object
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_model ⇒ Object
22 23 24 |
# File 'lib/generators/paypal/ipn_message_generator.rb', line 22 def copy_file "ipn_message.rb", "app/models/ipn_message.rb" end |
#create_ipn_message_migration ⇒ Object
14 15 16 |
# File 'lib/generators/paypal/ipn_message_generator.rb', line 14 def migration_template "migration.rb", "db/migrate/add_ipn_messages.rb" end |