Sha256: 9872d094bb70e63350ed7052c34cae0290a340be5955eb16ac5caccd5833b038

Contents?: true

Size: 618 Bytes

Versions: 6

Compression:

Stored size: 618 Bytes

Contents

require 'rails/generators/active_record'

module ActiveRecord
  module Generators
    class DeviseAuthyGenerator < ActiveRecord::Generators::Base
      source_root File.expand_path("../templates", __FILE__)

      def copy_devise_migration
        migration_template "migration.rb", "db/migrate/devise_authy_add_to_#{table_name}.rb", migration_version: migration_version
      end

      private

      def versioned_migrations?
        Rails::VERSION::MAJOR >= 5
      end

      def migration_version
        "[#{Rails::VERSION::MAJOR}.#{Rails::VERSION::MINOR}]" if versioned_migrations?
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
devise-authy-2.3.1 lib/generators/active_record/devise_authy_generator.rb
devise-authy-2.3.0 lib/generators/active_record/devise_authy_generator.rb
devise-authy-2.2.1 lib/generators/active_record/devise_authy_generator.rb
devise-authy-2.2.0 lib/generators/active_record/devise_authy_generator.rb
devise-authy-2.1.0 lib/generators/active_record/devise_authy_generator.rb
devise-authy-2.0.0 lib/generators/active_record/devise_authy_generator.rb