Sha256: 072a75640311aa8ef94412fe94c6a0b200c4ea939c05649b0edc41e18a41973f

Contents?: true

Size: 790 Bytes

Versions: 1

Compression:

Stored size: 790 Bytes

Contents

# frozen_string_literal: true

require "rails/generators"

module ActiveFields
  module Generators
    class InstallGenerator < ::Rails::Generators::Base
      desc "This generator creates an initializer and copies plugin migrations"

      def create_initializer
        initializer "active_fields.rb", <<~RUBY
          ActiveFields.configure do |config|
            # Change fields base class:
            # config.field_base_class_name = "CustomField"
            # Change value class:
            # config.value_class_name = "CustomValue"

            # Register custom field type:
            # config.register_field :ip, "IpField"
          end
        RUBY
      end

      def install_migrations
        rails_command "active_fields:install:migrations"
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_fields-1.1.0 lib/generators/active_fields/install/install_generator.rb