Sha256: 457da6f4033601dd39c5243e22181f44fae26a235c4b260fda0b16766c28dacb

Contents?: true

Size: 885 Bytes

Versions: 167

Compression:

Stored size: 885 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

167 entries across 167 versions & 1 rubygems

Version Path
pg_rails-7.0.8.pre.alpha.94 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.93 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.92 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.91 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.90 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.89 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.88 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.87 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.86 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.56 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.55 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.54 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.53 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.52 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.51 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.50 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.49 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.48 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.47 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb
pg_rails-7.0.8.pre.alpha.46 pg_scaffold/lib/pg_scaffold/monkey_patches/mejoras_a_named_base.rb