Sha256: 061e367d0a020d23b345d680f19677def58b14eeefd03350b075ba9f5bc05821

Contents?: true

Size: 926 Bytes

Versions: 25

Compression:

Stored size: 926 Bytes

Contents

# frozen_string_literal: true

require "rails/generators"
require "rails/generators/active_record"

module Doorkeeper
  # Generates migration to add confidential column to Doorkeeper
  # applications table.
  #
  class ConfidentialApplicationsGenerator < ::Rails::Generators::Base
    include ::Rails::Generators::Migration
    source_root File.expand_path("templates", __dir__)
    desc "Add confidential column to Doorkeeper applications"

    def confidential_applications
      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
      "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
doorkeeper-5.5.0.rc2 lib/generators/doorkeeper/confidential_applications_generator.rb
doorkeeper-5.5.0.rc1 lib/generators/doorkeeper/confidential_applications_generator.rb
doorkeeper-5.4.0 lib/generators/doorkeeper/confidential_applications_generator.rb
doorkeeper-5.4.0.rc2 lib/generators/doorkeeper/confidential_applications_generator.rb
doorkeeper-5.4.0.rc1 lib/generators/doorkeeper/confidential_applications_generator.rb