Refactor Asciicast#user
This commit is contained in:
parent
fb3d5dec7a
commit
83df37f48b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user