2012-02-28 18:29:54 +00:00
|
|
|
module Locomotive
|
|
|
|
module Liquid
|
|
|
|
module Drops
|
|
|
|
class CurrentUser < Base
|
2012-03-02 13:02:33 +00:00
|
|
|
|
|
|
|
include ::Rails.application.routes.url_helpers
|
|
|
|
|
2012-02-28 18:29:54 +00:00
|
|
|
def logged_in?
|
2012-03-01 16:07:09 +00:00
|
|
|
_source.present?
|
2012-02-28 18:29:54 +00:00
|
|
|
end
|
2012-03-02 13:02:33 +00:00
|
|
|
def name
|
2012-03-02 22:59:58 +00:00
|
|
|
_source.name if logged_in?
|
2012-03-02 13:02:33 +00:00
|
|
|
end
|
|
|
|
def email
|
2012-03-02 22:59:58 +00:00
|
|
|
_source.email if logged_in?
|
2012-03-02 13:02:33 +00:00
|
|
|
end
|
|
|
|
def logout_path
|
|
|
|
destroy_admin_session_path
|
|
|
|
end
|
|
|
|
def login_path
|
|
|
|
new_admin_session_path
|
|
|
|
end
|
2012-02-28 18:29:54 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|