@@ -258,13 +258,12 class User < ActiveRecord::Base | |||
|
258 | 258 | end |
|
259 | 259 | |
|
260 | 260 | def self.anonymous |
|
261 | return @anonymous_user if @anonymous_user | |
|
262 | 261 | anonymous_user = AnonymousUser.find(:first) |
|
263 | 262 | if anonymous_user.nil? |
|
264 | 263 | anonymous_user = AnonymousUser.create(:lastname => 'Anonymous', :firstname => '', :mail => '', :login => '', :status => 0) |
|
265 | 264 | raise 'Unable to create the anonymous user.' if anonymous_user.new_record? |
|
266 | 265 | end |
|
267 |
|
|
|
266 | anonymous_user | |
|
268 | 267 | end |
|
269 | 268 | |
|
270 | 269 | private |
General Comments 0
You need to be logged in to leave comments.
Login now