Class: JeraPayment::Generators::InstallGenerator

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

Instance Method Summary collapse

Instance Method Details

#callback_servicesObject



26
27
28
29
30
31
# File 'lib/generators/jera_payment/install_generator.rb', line 26

def callback_services
  copy_subscription_files
  copy_invoice_files
  
  copy_withdrawal_files
end

#generate_migrationsObject



17
18
19
20
21
22
23
24
# File 'lib/generators/jera_payment/install_generator.rb', line 17

def generate_migrations
  case self.behavior
  when :invoke
    generate "active_record:jera_payment", "migration"
  when :revoke
    Rails::Generators.invoke "active_record:jera_payment", ["migration"], behavior: :revoke
  end
end

#initializer_fileObject



9
10
11
# File 'lib/generators/jera_payment/install_generator.rb', line 9

def initializer_file
  template 'jera_payment.rb', 'config/initializers/jera_payment.rb'
end

#locale_fileObject



13
14
15
# File 'lib/generators/jera_payment/install_generator.rb', line 13

def locale_file
  copy_file '../../../../config/locale/jera_payment.pt-BR.yml', 'config/locales/jera_payment.pt-BR.yml'
end