Sha256: 1daa786b080311718f1022fbf9bda3680d40dc475ffb2f8dc6e0e037d75d67e3

Contents?: true

Size: 899 Bytes

Versions: 30

Compression:

Stored size: 899 Bytes

Contents

# frozen_string_literal: true

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

module Doorkeeper
  # Generates migration to add reference to owner of the
  # Doorkeeper application.
  #
  class ApplicationOwnerGenerator < ::Rails::Generators::Base
    include ::Rails::Generators::Migration
    source_root File.expand_path("templates", __dir__)
    desc "Provide support for client application ownership."

    def application_owner
      migration_template(
        "add_owner_to_application_migration.rb.erb",
        "db/migrate/add_owner_to_application.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

30 entries across 30 versions & 1 rubygems

Version Path
doorkeeper-5.8.1 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.8.0 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.7.1 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.7.0 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.9 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.8 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.7 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.6 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.5 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.4 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.3 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.2 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.1 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.0 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.0.rc2 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.6.0.rc1 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.5.4 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.5.3 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.5.2 lib/generators/doorkeeper/application_owner_generator.rb
doorkeeper-5.5.1 lib/generators/doorkeeper/application_owner_generator.rb