Class: Doorkeeper::PreviousRefreshTokenGenerator

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

Overview

Generates migration to add previous refresh token column to the database for Doorkeeper tables.

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.next_migration_number(path) ⇒ Object



15
16
17
# File 'lib/generators/doorkeeper/previous_refresh_token_generator.rb', line 15

def self.next_migration_number(path)
  ActiveRecord::Generators::Base.next_migration_number(path)
end

Instance Method Details

#previous_refresh_tokenObject



19
20
21
22
23
24
25
26
# File 'lib/generators/doorkeeper/previous_refresh_token_generator.rb', line 19

def previous_refresh_token
  return unless no_previous_refresh_token_column?

  migration_template(
    "add_previous_refresh_token_to_access_tokens.rb.erb",
    "db/migrate/add_previous_refresh_token_to_access_tokens.rb",
  )
end