Module: Alchemy::Page::PageUsers

Extended by:
ActiveSupport::Concern
Included in:
Alchemy::Page
Defined in:
app/models/alchemy/page/page_users.rb

Instance Method Summary collapse

Instance Method Details

#creatorObject

Returns the creator of this page.



7
8
9
# File 'app/models/alchemy/page/page_users.rb', line 7

def creator
  get_page_user(creator_id)
end

#creator_nameObject

Returns the name of the creator of this page.

If no creator could be found or associated user model does not respond to #name it returns ‘unknown’



28
29
30
# File 'app/models/alchemy/page/page_users.rb', line 28

def creator_name
  (creator && creator.try(:name)) || I18n.t('unknown')
end

#lockerObject

Returns the user currently editing this page.



19
20
21
# File 'app/models/alchemy/page/page_users.rb', line 19

def locker
  get_page_user(locked_by)
end

#locker_nameObject

Returns the name of the user currently editing this page.

If no locker could be found or associated user model does not respond to #name it returns ‘unknown’



46
47
48
# File 'app/models/alchemy/page/page_users.rb', line 46

def locker_name
  (locker && locker.try(:name)) || I18n.t('unknown')
end

#updaterObject

Returns the last updater of this page.



13
14
15
# File 'app/models/alchemy/page/page_users.rb', line 13

def updater
  get_page_user(updater_id)
end

#updater_nameObject

Returns the name of the last updater of this page.

If no updater could be found or associated user model does not respond to #name it returns ‘unknown’



37
38
39
# File 'app/models/alchemy/page/page_users.rb', line 37

def updater_name
  (updater && updater.try(:name)) || I18n.t('unknown')
end