Sha256: 9c63a3aa3eb135ac991244b3bae56a1eae8b166c4a4c6cf585ec2efb6fc9c3ad
Contents?: true
Size: 917 Bytes
Versions: 15
Compression:
Stored size: 917 Bytes
Contents
require 'rails/generators/active_record' require 'generators/devise/orm_helpers' module ActiveRecord module Generators class DeviseGenerator < ActiveRecord::Generators::Base argument :attributes, :type => :array, :default => [], :banner => "field:type field:type" include Devise::Generators::OrmHelpers source_root File.expand_path("../templates", __FILE__) def generate_model invoke "active_record:model", [name], :migration => false unless model_exists? end def copy_devise_migration migration_template "migration.rb", "db/migrate/devise_create_#{table_name}" end def inject_devise_content inject_into_class model_path, class_name, model_contents + <<-CONTENT # Setup accessible (or protected) attributes for your model attr_accessible :email, :password, :password_confirmation, :remember_me CONTENT end end end end
Version data entries
15 entries across 15 versions & 5 rubygems