class RailsPushNotifications::Generators::MigrationsGenerator

Public Class Methods

next_migration_number(path) click to toggle source
# File lib/generators/rails-push-notifications/migrations_generator.rb, line 22
def self.next_migration_number(path)
  @count ||= 0
  @count += 1
  (Time.now.utc.strftime("%Y%m%d%H%M%S").to_i + @count).to_s
end

Public Instance Methods

create_migrations() click to toggle source
# File lib/generators/rails-push-notifications/migrations_generator.rb, line 11
def create_migrations
  templates = [
    'create_rails_push_notifications_apps',
    'create_rails_push_notifications_notifications'
  ]

  templates.each do |file|
    migration_template("#{file}.rb", "db/migrate/#{file}.rb")
  end
end