README.md in agx-0.2.5 vs README.md in agx-0.2.6
- old
+ new
@@ -70,11 +70,10 @@
)
```
Initiate a sync transaction, make Sync API requests, and end transaction
-***Currently only get requests are supported***
```ruby
# To make calls without starting a transaction for resources that don't
# require it, use the get_nt method
# @agx_sync_client.get_nt("Resource", start_time)
# => 'parsed_json_response_body'
@@ -93,9 +92,24 @@
# Get all farms accessible for a grower
farms = @agx_sync_client.get("Grower/#{grower.guid}/Farm")
# Get all server changes on farms accessible for a grower since start_time
farms = @agx_sync_client.get("Grower/#{grower.guid}/Farm", last_sync_date.to_s)
+
+# Put (insert) a new Grower
+now = Time.now.utc
+new_grower = {
+ "SyncID": @agx_sync_client.sync_id,
+ "ID": SecureRandom.uuid,
+ "Name": "MYNEWGROWER",
+ "ModifiedOn": now,
+ "CreatedOn": now,
+ "CreatorID": @agx_sync_client.sync_id,
+ "EditorID": @agx_sync_client.sync_id,
+ "SchemaVersion": "4.0"
+}
+
+@client.put("Grower", new_grower.to_json)
# etc...
@agx_sync_client.end_transaction