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

Version Path
quo_vadis-1.4.2 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.4.1 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.4.0 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.3.2 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.3.1 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.3.0 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.2.3 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.2.2 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.2.1 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.2.0 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.1.2 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.1.1 lib/generators/quo_vadis/install_generator.rb
quo_vadis-1.1.0 lib/generators/quo_vadis/install_generator.rb