Sha256: 4aa97d2a3741e4098138044122798be1b37ce043ea0dacdd9933b82e364bf3fa

Contents?: true

Size: 633 Bytes

Versions: 8

Compression:

Stored size: 633 Bytes

Contents

require 'rails/generators/active_record'

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

      def copy_devise_migration
        migration_template "migration.rb", "db/migrate/devise_twilio_verify_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

8 entries across 8 versions & 1 rubygems

Version Path
devise-twilio-verify-0.2.5 lib/generators/active_record/devise_twilio_verify_generator.rb
devise-twilio-verify-0.2.4 lib/generators/active_record/devise_twilio_verify_generator.rb
devise-twilio-verify-0.2.3 lib/generators/active_record/devise_twilio_verify_generator.rb
devise-twilio-verify-0.2.2 lib/generators/active_record/devise_twilio_verify_generator.rb
devise-twilio-verify-0.2.1 lib/generators/active_record/devise_twilio_verify_generator.rb
devise-twilio-verify-0.2.0 lib/generators/active_record/devise_twilio_verify_generator.rb
devise-twilio-verify-0.1.1 lib/generators/active_record/devise_twilio_verify_generator.rb
devise-twilio-verify-0.1.0 lib/generators/active_record/devise_twilio_verify_generator.rb