Sha256: c7a84db95fed90759006d0a71a0662b1cf5b3bd87a421fa986b32c6890c9f5d3

Contents?: true

Size: 866 Bytes

Versions: 8

Compression:

Stored size: 866 Bytes

Contents

# frozen_string_literal: true

require 'rails/generators'
require 'rails/generators/active_record'

module Doorkeeper
  class ConfidentialApplicationsGenerator < ::Rails::Generators::Base
    include ::Rails::Generators::Migration
    source_root File.expand_path('templates', __dir__)
    desc 'Add confidential column to Doorkeeper applications'

    def pkce
      migration_template(
        'add_confidential_to_applications.rb.erb',
        'db/migrate/add_confidential_to_applications.rb',
        migration_version: migration_version
      )
    end

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

    private

    def migration_version
      if ActiveRecord::VERSION::MAJOR >= 5
        "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
doorkeeper-5.0.3 lib/generators/doorkeeper/confidential_applications_generator.rb
doorkeeper-5.1.0.rc2 lib/generators/doorkeeper/confidential_applications_generator.rb
doorkeeper-5.1.0.rc1 lib/generators/doorkeeper/confidential_applications_generator.rb
doorkeeper-5.0.2 lib/generators/doorkeeper/confidential_applications_generator.rb
doorkeeper-5.0.1 lib/generators/doorkeeper/confidential_applications_generator.rb
doorkeeper-5.0.0 lib/generators/doorkeeper/confidential_applications_generator.rb
doorkeeper-5.0.0.rc2 lib/generators/doorkeeper/confidential_applications_generator.rb
doorkeeper-5.0.0.rc1 lib/generators/doorkeeper/confidential_applications_generator.rb