diff --git a/app/models/curation_post_section.rb b/app/models/curation_post_section.rb index 28106f4..1b655f3 100644 --- a/app/models/curation_post_section.rb +++ b/app/models/curation_post_section.rb @@ -47,13 +47,14 @@ class CurationPostSection end def get_frontend_object - case self.section_type + uid = self.id.to_s[0,5] + self.id.to_s[-5,5] + case self.section_type when "universal_table" { "section" => self.title, - "section_uid" => self.id.to_s[0..5], + "section_uid" => uid, "entries" => self.get_table_entries_for_frontend, - "url_to_show" => "", + "type" => self.section_type, "text" => "", "mind_map_title" => "", "mind_map_data" => "" @@ -61,11 +62,9 @@ class CurationPostSection when "text" { "section" => self.title, - "section_uid" => self.id.to_s[0..5], + "section_uid" => uid, "entries" => [], - "uid" => "", "type" => self.section_type, - "url_to_show" => "", "text" => self.text.html_safe, "mind_map_title" => "", "mind_map_data" => "" @@ -74,14 +73,12 @@ class CurationPostSection mm = MindMap.find(self.mind_map_id) { "section" => self.title, - "section_uid" => self.id.to_s[0..5], + "section_uid" => uid, "entries" => [], - "mind_map_title" => mm.title, - "mind_map_data" => mm.mind_map_data.to_json, - "uid" => "", "type" => self.section_type, - "url_to_show" => "", - "text" => "" + "text" => "", + "mind_map_title" => mm.title, + "mind_map_data" => mm.mind_map_data.to_json } end end