Class: Pu::Gem::ActiveShrineGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Includes:
PlutoniumGenerators::Generator
Defined in:
lib/generators/pu/gem/active_shrine/active_shrine_generator.rb

Instance Method Summary collapse

Methods included from PlutoniumGenerators::Generator

derive_association_name, find_shared_namespace, included

Methods included from PlutoniumGenerators::Concerns::Logger

#debug, #error, #exception, #info, #success, #warn

Methods included from PlutoniumGenerators::Concerns::Config

#read_config, #write_config

Instance Method Details

#startObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/generators/pu/gem/active_shrine/active_shrine_generator.rb', line 19

def start
  bundle "active_shrine"
  bundle "aws-sdk-s3" if options[:s3]
  bundle "fastimage" if options[:store_dimensions]

  generate "active_shrine:install"
  template "config/initializers/shrine.rb", force: true

  disable_active_storage_railtie
  include_active_shrine_model_in_application_record
rescue => e
  exception "#{self.class} failed:", e
end