dmail.rb: make to_name= use User.name_to_id cache.
This commit is contained in:
@@ -28,9 +28,7 @@ class Dmail < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def to_name=(name)
|
def to_name=(name)
|
||||||
user = User.find_by_name(name)
|
self.to_id = User.name_to_id(name)
|
||||||
return if user.nil?
|
|
||||||
self.to_id = user.id
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def initialize_from_id
|
def initialize_from_id
|
||||||
|
|||||||
Reference in New Issue
Block a user