Sha256: 80f30d2c63b4c95f9ef8987054de951b75cf16464202c2fd2fe4bbe84e9e6b00
Contents?: true
Size: 878 Bytes
Versions: 13
Compression:
Stored size: 878 Bytes
Contents
require 'rails/generators' require 'rails/generators/migration' require 'rails/generators/active_record/migration' module QuoVadis class InstallGenerator < Rails::Generators::Base include Rails::Generators::Migration extend ActiveRecord::Generators::Migration source_root File.expand_path('../templates', __FILE__) argument :model_name, :type => :string, :default => 'User' desc 'Copies an initializer, a locale file, and a migration to your application.' def copy_locale_file copy_file '../../../../config/locales/quo_vadis.en.yml', 'config/locales/quo_vadis.en.yml' end def copy_initializer_file template 'quo_vadis.rb.erb', 'config/initializers/quo_vadis.rb' end def create_migration_file migration_template 'migration.rb.erb', "db/migrate/add_authentication_to_#{model_name.tableize}.rb" end end end
Version data entries
13 entries across 13 versions & 1 rubygems