1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00
heartcombo--devise/lib/generators/mongoid/devise_generator.rb

17 lines
No EOL
467 B
Ruby

require 'generators/devise/orm_helpers'
module Mongoid
module Generators
class DeviseGenerator < Rails::Generators::NamedBase
include Devise::Generators::OrmHelpers
def generate_model
invoke "mongoid:model", [name] unless model_exists? && behavior == :invoke
end
def inject_devise_content
inject_into_file model_path, model_contents, :after => "include Mongoid::Document\n" if model_exists?
end
end
end
end