diff --git a/app/models/page.rb b/app/models/page.rb index fbbdfae..dd82ab3 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -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 ## diff --git a/db/migrate/007_create_peoples.rb b/db/migrate/007_create_peoples.rb index a5fda73..e4ea232 100644 --- a/db/migrate/007_create_peoples.rb +++ b/db/migrate/007_create_peoples.rb @@ -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