class Adyen::NotificationGenerator

@private

Public Class Methods

next_migration_number(dirname) click to toggle source

Implement the required interface for Rails::Generators::Migration. taken from github.com/rails/rails/blob/master/activerecord/lib/generators/active_record.rb

   # File lib/adyen/notification_generator.rb
14 def self.next_migration_number(dirname)
15   if ActiveRecord::Base.timestamped_migrations
16     Time.now.utc.strftime("%Y%m%d%H%M%S")
17   else
18     "%.3d" % (current_migration_number(dirname) + 1)
19   end
20 end
source_root() click to toggle source
   # File lib/adyen/notification_generator.rb
 8 def self.source_root
 9   @source_root ||= File.join(File.dirname(__FILE__), 'templates')
10 end

Public Instance Methods

create_migration_file() click to toggle source

Create a migration file for the adyen_notifications table

   # File lib/adyen/notification_generator.rb
23 def create_migration_file
24   migration_template 'notification_migration.rb', 'db/migrate/create_adyen_notifications.rb'
25 end
create_model_file() click to toggle source
   # File lib/adyen/notification_generator.rb
27 def create_model_file
28   template 'notification_model.rb', 'app/models/adyen_notification.rb'
29 end