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-09-25 10:08:46 -04:00
|
|
|
# :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :oauthable
|
2010-07-04 11:08:00 -04:00
|
|
|
devise :database_authenticatable, :registerable,
|
|
|
|
:recoverable, :rememberable, :trackable, :validatable
|
|
|
|
|
|
|
|
CONTENT
|
|
|
|
end
|
|
|
|
|
|
|
|
def model_exists?
|
2010-09-25 06:37:06 -04:00
|
|
|
return @model_exists if instance_variable_defined?(:@model_exists)
|
|
|
|
@model_exists = 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
|