Sha256: b2f87f5d2267b27e85bc6dd2bbe32fbbbf3c54602e3dc5e401c521c8cdc9890c

Contents?: true

Size: 578 Bytes

Versions: 51

Compression:

Stored size: 578 Bytes

Contents

# frozen_string_literal: true

require_relative "../../lib/plutonium_generators"

module Pu
  module Res
    class ModelGenerator < PlutoniumGenerators::ModelGeneratorBase
      source_root File.expand_path("templates", __dir__)

      def run_create_module
        create_module_file if create_files?
      end

      def run_create_model
        create_model_file if create_files?
      end

      def run_create_migration
        create_migration_file if create_files?
      end

      private

      def create_files?
        attributes.present?
      end
    end
  end
end

Version data entries

51 entries across 51 versions & 1 rubygems

Version Path
plutonium-0.19.8 lib/generators/pu/res/model/model_generator.rb
plutonium-0.19.7 lib/generators/pu/res/model/model_generator.rb
plutonium-0.19.6 lib/generators/pu/res/model/model_generator.rb
plutonium-0.19.5 lib/generators/pu/res/model/model_generator.rb
plutonium-0.19.4 lib/generators/pu/res/model/model_generator.rb
plutonium-0.19.3 lib/generators/pu/res/model/model_generator.rb
plutonium-0.19.2 lib/generators/pu/res/model/model_generator.rb
plutonium-0.19.1 lib/generators/pu/res/model/model_generator.rb
plutonium-0.19.0 lib/generators/pu/res/model/model_generator.rb
plutonium-0.18.8 lib/generators/pu/res/model/model_generator.rb
plutonium-0.18.7 lib/generators/pu/res/model/model_generator.rb
plutonium-0.18.6 lib/generators/pu/res/model/model_generator.rb
plutonium-0.18.5 lib/generators/pu/res/model/model_generator.rb
plutonium-0.18.4 lib/generators/pu/res/model/model_generator.rb
plutonium-0.18.3 lib/generators/pu/res/model/model_generator.rb
plutonium-0.18.2 lib/generators/pu/res/model/model_generator.rb
plutonium-0.18.1 lib/generators/pu/res/model/model_generator.rb
plutonium-0.18.0 lib/generators/pu/res/model/model_generator.rb
plutonium-0.16.5 lib/generators/pu/res/model/model_generator.rb
plutonium-0.16.4 lib/generators/pu/res/model/model_generator.rb