2010-07-04 11:08:00 -04:00
|
|
|
module Devise
|
|
|
|
module Generators
|
|
|
|
module OrmHelpers
|
|
|
|
def model_contents
|
|
|
|
<<-CONTENT
|
|
|
|
# Include default devise modules. Others available are:
|
2010-10-14 17:46:10 -04:00
|
|
|
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable
|
2010-07-04 11:08:00 -04:00
|
|
|
devise :database_authenticatable, :registerable,
|
|
|
|
:recoverable, :rememberable, :trackable, :validatable
|
|
|
|
|
|
|
|
CONTENT
|
|
|
|
end
|
|
|
|
|
|
|
|
def model_exists?
|
2010-12-09 17:03:48 -05:00
|
|
|
File.exists?(File.join(destination_root, model_path))
|
2010-07-04 11:08:00 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def model_path
|
|
|
|
@model_path ||= File.join("app", "models", "#{file_path}.rb")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|