This repository has been archived on 2020-05-27. You can view files and clone it, but cannot push or open issues/pull-requests.
2007-12-03 03:47:21 -05:00
|
|
|
##
|
|
|
|
# This model represents a user in the system.
|
|
|
|
#
|
|
|
|
class People < ActiveRecord::Base
|
|
|
|
has_one_tuxwiki_page :owner_class => 'People'
|
2007-12-06 12:31:17 -05:00
|
|
|
belongs_to :role
|
|
|
|
attr_protected :role_id
|
2007-12-27 00:19:13 -05:00
|
|
|
has_many :created_pages, :class_name => 'Page', :foreign_key => 'created_by'
|
|
|
|
has_many :updated_pages, :class_name => 'Page', :foreign_key => 'updated_by'
|
2007-12-06 12:31:17 -05:00
|
|
|
|
|
|
|
##
|
2007-12-22 19:32:08 -05:00
|
|
|
# Finds the Guest user for the system.
|
2007-12-06 12:31:17 -05:00
|
|
|
#
|
2007-12-22 19:32:08 -05:00
|
|
|
def self.guest_user
|
|
|
|
self.find_by_title('Guest') rescue nil
|
2007-12-06 12:31:17 -05:00
|
|
|
end
|
2007-12-27 01:13:08 -05:00
|
|
|
|
|
|
|
##
|
|
|
|
# Finds me.
|
|
|
|
#
|
|
|
|
def self.penguincoder
|
|
|
|
self.find_by_title('PenguinCoder') rescue nil
|
|
|
|
end
|
2007-12-03 03:47:21 -05:00
|
|
|
end
|