Sha256: f2631ce3973f19fad0b0e06f7ab6820996e6e30e15aaca0de7ad4afbc1595f1a

Contents?: true

Size: 650 Bytes

Versions: 3

Compression:

Stored size: 650 Bytes

Contents

require "rails/generators/active_record"

module Authtrail
  module Generators
    class InstallGenerator < Rails::Generators::Base
      include ActiveRecord::Generators::Migration
      source_root File.join(__dir__, "templates")

      def copy_migration
        migration_template "login_activities_migration.rb", "db/migrate/create_login_activities.rb", migration_version: migration_version
      end

      def generate_model
        template "login_activity_model.rb", "app/models/login_activity.rb"
      end

      def migration_version
        "[#{ActiveRecord::VERSION::MAJOR}.#{ActiveRecord::VERSION::MINOR}]"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
authtrail-0.2.2 lib/generators/authtrail/install_generator.rb
authtrail-0.2.1 lib/generators/authtrail/install_generator.rb
authtrail-0.2.0 lib/generators/authtrail/install_generator.rb