|
|
@ -32,8 +32,13 @@ module Mobile
|
|
|
|
news_expose :title
|
|
|
|
news_expose :title
|
|
|
|
|
|
|
|
|
|
|
|
expose :author,using: Mobile::Entities::User do |f, opt|
|
|
|
|
expose :author,using: Mobile::Entities::User do |f, opt|
|
|
|
|
#n = f[:author]
|
|
|
|
obj = nil
|
|
|
|
f.author if f.respond_to?(:author)
|
|
|
|
if f.is_a?(::News) && f.respond_to?(:author)
|
|
|
|
|
|
|
|
obj = f.send(:author)
|
|
|
|
|
|
|
|
elsif f.is_a?(Hash) && f.key?(:author)
|
|
|
|
|
|
|
|
obj = f[:author]
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
obj
|
|
|
|
end
|
|
|
|
end
|
|
|
|
#作者id
|
|
|
|
#作者id
|
|
|
|
news_expose :author_id
|
|
|
|
news_expose :author_id
|
|
|
|