Sha256: 0a5220c4d4aa309aaf126c633d3feeb2051ce8d68c563b10f0263ce51b269dfd
Contents?: true
Size: 883 Bytes
Versions: 19
Compression:
Stored size: 883 Bytes
Contents
require 'rake' require 'rails/generators' module Cambium class UserGenerator < Rails::Generators::Base desc "Create a new user for your app." source_root File.expand_path('../../templates', __FILE__) class_option( :admin, :type => :boolean, :default => false, :description => "Make the user an admin" ) argument :email, :type => :string argument :password, :type => :string # Create a user with the provided credentials def create_user if options.admin == true User.create!( :email => email, :password => password, :password_confirmation => password, :is_admin => options.admin ) else User.create!( :email => email, :password => password, :password_confirmation => password ) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems