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.16.3 lib/generators/pu/res/model/model_generator.rb
plutonium-0.16.1 lib/generators/pu/res/model/model_generator.rb
plutonium-0.16.0 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.24 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.23 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.22 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.21 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.20 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.19 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.18 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.17 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.16 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.15 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.14 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.13 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.12 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.11 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.10 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.9 lib/generators/pu/res/model/model_generator.rb
plutonium-0.15.8 lib/generators/pu/res/model/model_generator.rb