adding default user as myself for all console or backend-generated material

git-svn-id: http://svn.barleysodas.com/barleysodas/trunk@66 0f7b21a7-9e3a-4941-bbeb-ce5c7c368fa7
master
andrew 2007-12-27 06:12:15 +00:00
parent 223c45559f
commit 4a5033b3f8
2 changed files with 5 additions and 2 deletions

View File

@ -73,14 +73,16 @@ class Page < ActiveRecord::Base
# Sets the People marker for created_by on creation.
#
def set_created_person
self[:created_by] = ApplicationController.current_people_id
self[:created_by] = ApplicationController.current_people_id rescue nil
self.created_by ||= People.penguincoder
end
##
# Sets the People marker for updated_by on save.
#
def set_updated_person
self[:updated_by] = ApplicationController.current_people_id
self[:updated_by] = ApplicationController.current_people_id rescue nil
self.created_by ||= People.penguincoder
end
##

View File

@ -4,6 +4,7 @@ class CreatePeoples < ActiveRecord::Migration
t.column :title, :string
end
People.create :title => 'Guest', :page => Page.new
People.create :title => 'PenguinCoder', :page => Page.new
end
def self.down