Sha256: 60c9dc0b4320dbe3919a81b54659bf5cd3b90cda76cadc5cb4d3b8788e88d865

Contents?: true

Size: 901 Bytes

Versions: 1

Compression:

Stored size: 901 Bytes

Contents

# frozen_string_literal: true

require 'rails/generators/named_base'

module Rails
  module Generators
    class NamedBase < Base
      def nombre_clase_completo
        # if namespaced?
        #   (namespaced_class_path + [file_name]).map!(&:camelize).join('::')
        # else
        #   (regular_class_path + [file_name]).map!(&:camelize).join('::')
        # end
        file_name.camelize
      end

      def nombre_tabla_completo_singular
        if namespaced?
          (namespaced_class_path + [singular_name]).join('_')
        else
          (regular_class_path + [singular_name]).join('_')
        end
      end

      private

        # Deprecado?
        def ruta_vistas
          if namespaced?
            namespaced_class_path.dup.push(plural_name).join('/')
          else
            regular_class_path.dup.push(plural_name).join('/')
          end
        end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pg_scaffold-0.1.0 lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb