2015-01-22 17:21:15 +08:00
|
|
|
module Mobile
|
|
|
|
module Entities
|
2015-01-23 11:42:35 +08:00
|
|
|
#带评分的留言(教师评论、学生匿名评分都属于此类)
|
2015-01-22 17:21:15 +08:00
|
|
|
class HomeworkJours < Grape::Entity
|
|
|
|
include Redmine::I18n
|
|
|
|
def self.homework_jours_expose(field)
|
|
|
|
expose field do |f,opt|
|
|
|
|
if f.is_a?(Hash) && f.key?(field)
|
|
|
|
f[field]
|
|
|
|
elsif f.is_a?(::SeemsRateableRates)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
homework_jours_expose :rater_id
|
|
|
|
homework_jours_expose :rater_name
|
|
|
|
homework_jours_expose :created_at
|
|
|
|
homework_jours_expose :stars
|
|
|
|
expose :comment,using: Mobile::Entities::Jours do |f,opt|
|
|
|
|
f[:comment]
|
|
|
|
end
|
2015-01-23 11:42:35 +08:00
|
|
|
|
2015-01-22 17:21:15 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|