Class: RapnsGenerator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



5
6
7
8
9
10
# File 'lib/generators/rapns_generator.rb', line 5

def self.next_migration_number(path)
  @time ||= Time.now.utc
  @calls ||= -1
  @calls += 1
  (@time + @calls.seconds).strftime("%Y%m%d%H%M%S")
end

Instance Method Details

#copy_configObject



20
21
22
# File 'lib/generators/rapns_generator.rb', line 20

def copy_config
  copy_file 'rapns.yml', 'config/rapns/rapns.yml'
end

#copy_migrationObject



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

def copy_migration
  add_rapns_migration('create_rapns_notifications')
  add_rapns_migration('create_rapns_feedback')
  add_rapns_migration('add_alert_is_json_to_rapns_notifications')
  add_rapns_migration('add_retry_count_to_rapns_notifications')
  add_rapns_migration('add_web_service_notification_request_id_to_rapns_notifications')
end