class FwtPushNotificationServer::Generators::InstallGenerator

Public Class Methods

next_migration_number(path) click to toggle source
# File lib/generators/fwt_push_notification_server/install/install_generator.rb, line 14
def self.next_migration_number(path)
  unless @prev_migration_nr
    @prev_migration_nr = Time.now.utc.strftime("%Y%m%d%H%M%S").to_i
  else
    @prev_migration_nr += 1
  end
  @prev_migration_nr.to_s
end

Public Instance Methods

copy_initializer_file() click to toggle source
# File lib/generators/fwt_push_notification_server/install/install_generator.rb, line 30
def copy_initializer_file
  copy_file "initializer.rb", "config/initializers/#{app_name}.rb"
end
copy_migrations() click to toggle source
# File lib/generators/fwt_push_notification_server/install/install_generator.rb, line 23
def copy_migrations
  migration_template "create_fwt_push_notification_server_device_tokens.rb", "db/migrate/create_fwt_push_notification_server_device_tokens.rb"
  migration_template "add_provider_to_push_notification_server_device_tokens.rb", "db/migrate/add_provider_to_push_notification_server_device_tokens.rb"
end

Private Instance Methods

app_name() click to toggle source
# File lib/generators/fwt_push_notification_server/install/install_generator.rb, line 35
def app_name
  "fwt_push_notification_server"
end