mirror of
https://github.com/heartcombo/devise.git
synced 2022-11-09 12:18:31 -05:00
25 lines
627 B
Ruby
25 lines
627 B
Ruby
require File.expand_path(File.dirname(__FILE__) + "/lib/route_devise.rb")
|
|
|
|
class DeviseGenerator < Rails::Generator::NamedBase
|
|
|
|
def manifest
|
|
record do |m|
|
|
# Check for class naming collisions.
|
|
m.class_collisions(class_name)
|
|
|
|
# Model
|
|
m.directory(File.join('app', 'models', class_path))
|
|
m.template 'model.rb', File.join('app', 'models', "#{file_path}.rb")
|
|
|
|
# Migration
|
|
m.migration_template 'migration.rb', 'db/migrate', :migration_file_name => "devise_create_#{table_name}"
|
|
|
|
# Routing
|
|
m.route_devise table_name
|
|
|
|
# Readme
|
|
m.readme "README"
|
|
end
|
|
end
|
|
|
|
end
|