Sha256: feb36fe5081ed2d3847736b216c49d7b7ba4425087b456dd15ac493003b046ae

Contents?: true

Size: 618 Bytes

Versions: 13

Compression:

Stored size: 618 Bytes

Contents

require "rails/generators/active_record"

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

      def copy_migration
        migration_template "memberships.rb", "db/migrate/create_field_test_memberships.rb", migration_version: migration_version
      end

      def copy_config
        template "config.yml", "config/field_test.yml"
      end

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

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
field_test-0.7.0 lib/generators/field_test/install_generator.rb
field_test-0.6.1 lib/generators/field_test/install_generator.rb
field_test-0.6.0 lib/generators/field_test/install_generator.rb
field_test-0.5.5 lib/generators/field_test/install_generator.rb
field_test-0.5.4 lib/generators/field_test/install_generator.rb
field_test-0.5.3 lib/generators/field_test/install_generator.rb
field_test-0.5.2 lib/generators/field_test/install_generator.rb
field_test-0.5.1 lib/generators/field_test/install_generator.rb
field_test-0.5.0 lib/generators/field_test/install_generator.rb
field_test-0.4.1 lib/generators/field_test/install_generator.rb
field_test-0.4.0 lib/generators/field_test/install_generator.rb
field_test-0.3.2 lib/generators/field_test/install_generator.rb
field_test-0.3.1 lib/generators/field_test/install_generator.rb