module Scrivito class ObjUiConfig < Struct.new(:obj) def self.mget(*ids) objs = Obj.find(ids) ids.map do |id| if obj = objs.find { |o| o.id == id } ObjUiConfig.new(obj) end end end def as_json { description_for_editor: obj.description_for_editor, info_for_content_browser: obj.try(:info_for_content_browser), }.compact end end end