Refactor Asciicast#user

This commit is contained in:
Marcin Kulik 2014-02-12 21:33:42 +01:00
parent fb3d5dec7a
commit 83df37f48b

View File

@ -51,7 +51,7 @@ class Asciicast < ActiveRecord::Base
end
def user
super || self.user = User.new(username: 'anonymous').tap { |u| u.dummy = true }
super || self.user = dummy_user
end
def stdout
@ -74,4 +74,10 @@ class Asciicast < ActiveRecord::Base
end
end
private
def dummy_user
User.new(username: 'anonymous').tap { |u| u.dummy = true }
end
end