better caching of variable
git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@68 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7master
parent
4c311e40a4
commit
d371d2b505
|
@ -74,7 +74,7 @@ class Page < ActiveRecord::Base
|
|||
#
|
||||
def set_created_person
|
||||
self[:created_by] = ApplicationController.current_people_id rescue nil
|
||||
self.created_by ||= People.penguincoder
|
||||
self[:created_by] ||= People.penguincoder
|
||||
end
|
||||
|
||||
##
|
||||
|
@ -82,7 +82,7 @@ class Page < ActiveRecord::Base
|
|||
#
|
||||
def set_updated_person
|
||||
self[:updated_by] = ApplicationController.current_people_id rescue nil
|
||||
self.created_by ||= People.penguincoder
|
||||
self[:updated_by] ||= People.penguincoder
|
||||
end
|
||||
|
||||
##
|
||||
|
|
|
@ -19,6 +19,7 @@ class People < ActiveRecord::Base
|
|||
# Finds me.
|
||||
#
|
||||
def self.penguincoder
|
||||
self.find_by_title('PenguinCoder') rescue nil
|
||||
@penguincoder ||= self.find_by_title('PenguinCoder') rescue nil
|
||||
@penguincoder
|
||||
end
|
||||
end
|
||||
|
|
Reference in New Issue