Sha256: c23a0043930b28938b8082d5796bea3c607c96f762a6bd8ad35f66d660a7e324

Contents?: true

Size: 1.02 KB

Versions: 164

Compression:

Stored size: 1.02 KB

Contents

# frozen_string_literal: true

require 'generators/slim/scaffold/scaffold_generator'

class PgSlimGenerator < Slim::Generators::ScaffoldGenerator
  source_root File.expand_path('templates', __dir__)

  class_option :paranoia, type: :boolean, default: false, desc: 'Paranoid y deleted_at.'
  class_option :discard, type: :boolean, default: false, desc: 'Discard y discarded_at.'
  class_option :trackeo_de_usuarios, type: :boolean, default: true,
                                     desc: 'Genera campos creado_por y actualizado_por.'
  class_option :download_file, type: :boolean, default: false, desc: 'Archivo de download'
  class_option :index_file, type: :boolean, default: false, desc: 'Archivo de index'

  def copiar_download
    return unless options[:download_file]

    template 'download.xlsx.axlsx',
             File.join('app', 'views', controller_file_path, 'download.xlsx.axlsx')
  end

  protected

  def available_views
    if options[:index_file]
      %w[index show _form]
    else
      %w[show _form]
    end
  end
end

Version data entries

164 entries across 164 versions & 1 rubygems

Version Path
pg_rails-7.6.28 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.27 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.26 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.25 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.24 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.24.pre.5 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.24.pre.4 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.24.pre.3 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.23 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.22 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.22.pre.3 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.22.pre.2 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.22.pre.1 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.21 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.21.pre.11 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.21.pre.10 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.21.pre.9 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.21.pre.8 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.21.pre.7 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb
pg_rails-7.6.21.pre.6 pg_scaffold/lib/generators/pg_slim/pg_slim_generator.rb