lib/dhis2/api/base.rb in dhis2-2.3.3 vs lib/dhis2/api/base.rb in dhis2-2.3.4
- old
+ new
@@ -90,9 +90,19 @@
self[key] = value
end
self
end
+ def add_relation(relation, relation_id)
+ client.post("#{self.class.resource_name}/#{id}/#{relation}/#{relation_id}",{})
+ self
+ end
+
+ def remove_relation(relation, relation_id)
+ client.delete("#{self.class.resource_name}/#{id}/#{relation}/#{relation_id}",{})
+ self
+ end
+
def delete
client.delete("#{self.class.resource_name}/#{id}")
true
end