Class: Passbook::Generators::ConfigGenerator

Inherits:
Rails::Generators::Base
  • Object
show all
Defined in:
lib/rails/generators/passbook/config/config_generator.rb

Instance Method Summary collapse

Instance Method Details

#create_initializer_fileObject



28
29
30
31
32
33
# File 'lib/rails/generators/passbook/config/config_generator.rb', line 28

def create_initializer_file
  path = "#{Rails.root}/data/certificates"
  FileUtils.mkdir_p path if wwdr_certificate_path.blank? && !File.exists?(path)
  template 'initializer.rb', File.join('config', 'initializers', 'passbook.rb')
  template 'migration.rb', File.join('db', 'migrate', "#{Time.now.strftime("%Y%m%d%H%M%S")}_create_passbook_registrations.rb")
end