Sha256: 2d7f88236de6f6d1e1839a002fe27b8cab0cd3b32e382a16242db82fe637e57b
Contents?: true
Size: 1.13 KB
Versions: 13
Compression:
Stored size: 1.13 KB
Contents
require 'rails/generators/migration' module FwtPushNotificationServer module Generators class InstallGenerator < ::Rails::Generators::Base include Rails::Generators::Migration source_root File.expand_path('../templates', __FILE__) desc "Add the migrations" 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 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 desc "Add initializer" def copy_initializer_file copy_file "initializer.rb", "config/initializers/#{app_name}.rb" end private def app_name "fwt_push_notification_server" end end end end
Version data entries
13 entries across 13 versions & 1 rubygems