Class: ActiveStorageSaas::InstallGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/generators/active_storage_saas/install/install_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_filesObject



15
16
17
# File 'lib/generators/active_storage_saas/install/install_generator.rb', line 15

def copy_files
  template 'config/initializers/active_storage_saas.rb'
end

#generate_modelObject



6
7
8
9
10
11
12
13
# File 'lib/generators/active_storage_saas/install/install_generator.rb', line 6

def generate_model
  generate "model", "#{options['configuration_model']} service_name service_options:json"
  inject_into_file "app/models/#{options['configuration_model'].underscore}.rb", after: /^class .+\n/ do <<-'RUBY'
  include ActiveStorageSaas::StorageServiceConfigurationMixin

RUBY
  end
end