lib/atlas_rb/community.rb in atlas_rb-0.0.49 vs lib/atlas_rb/community.rb in atlas_rb-0.0.51

- old
+ new

@@ -6,11 +6,13 @@ def self.find(id) JSON.parse(connection({}).get(ROUTE + id)&.body)["community"] end - def self.create(id = nil) - JSON.parse(connection({ parent_id: id }).post(ROUTE)&.body)["community"] + def self.create(id = nil, xml_path = nil) + result = JSON.parse(connection({ parent_id: id }).post(ROUTE)&.body)["community"] + update(result["id"], xml_path) if xml_path.present? + result end def self.destroy(id) connection({}).delete(ROUTE + id) end