历史数据中当课程名称字段为空时从项目列表里获取名称

This commit is contained in:
sw 2014-07-04 11:30:22 +08:00
parent 1e6693cdcf
commit 0e0b8fb8d8
1 changed files with 3 additions and 0 deletions

View File

@ -275,4 +275,7 @@ class Course < ActiveRecord::Base
end
end
def name
read_attribute('name') || Project.find_by_identifier(self.extra).try(:name)
end
end