syncano 3.1.1.beta4 → 3.1.1.beta5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +22 -2
- data/lib/syncano/clients/sync.rb +2 -0
- data/lib/syncano/resources/base.rb +5 -2
- data/lib/syncano/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de0d4d181523b5d081bcfffad1a726be2a515cf3
|
4
|
+
data.tar.gz: 7bf73f1a965e8d7ad82c97dc43fa1b3e41fe3f7a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca1c6352decade66e64eecf110f83d9de1ff852c263468c233ce98acd1b74cc9f02deafef4091ee7579823d795fe37d49959cf897576d86048e03f23d3da929f
|
7
|
+
data.tar.gz: 542c9ecbb11261a19e8d49b7c17b81b281c929eafa2e4b28fa00aaaea57a4154c2f9518c8bcd12b2deb1283db56b7cfb2ab46ecbf9019721199cc9d0b12caac8
|
data/README.md
CHANGED
@@ -10,7 +10,7 @@ Click here to learn more about [Syncano](http://www.syncano.com) or [create an a
|
|
10
10
|
|
11
11
|
Add this line to your application's Gemfile:
|
12
12
|
|
13
|
-
gem 'syncano', '~> 3.1.1.
|
13
|
+
gem 'syncano', '~> 3.1.1.beta5'
|
14
14
|
|
15
15
|
And then execute:
|
16
16
|
|
@@ -18,7 +18,7 @@ And then execute:
|
|
18
18
|
|
19
19
|
Or install it yourself as:
|
20
20
|
|
21
|
-
$ gem install syncano -v 3.1.1.
|
21
|
+
$ gem install syncano -v 3.1.1.beta5 --pre
|
22
22
|
|
23
23
|
At the end generate initializer with api key and api instance name:
|
24
24
|
|
@@ -311,6 +311,26 @@ To delete callback from the queue just call remove_callback method:
|
|
311
311
|
client.remove_callback(:callback_name)
|
312
312
|
```
|
313
313
|
|
314
|
+
To list notifications ie. after connection use all method:
|
315
|
+
|
316
|
+
```ruby
|
317
|
+
client.notifications.all
|
318
|
+
```
|
319
|
+
|
320
|
+
#### Sending notifications
|
321
|
+
|
322
|
+
To send notification just create new notification object:
|
323
|
+
|
324
|
+
```ruby
|
325
|
+
client.notifications.create(key: 'value')
|
326
|
+
```
|
327
|
+
|
328
|
+
You can also pass additional attributes specified for api 'notification.send' method:
|
329
|
+
|
330
|
+
```ruby
|
331
|
+
client.notifications.create(key: 'value', api_client_id: 512)
|
332
|
+
```
|
333
|
+
|
314
334
|
### Errors and exceptions
|
315
335
|
|
316
336
|
This library does not implement any validations. All errors from the api will cause throwing an exception.
|
data/lib/syncano/clients/sync.rb
CHANGED
@@ -128,8 +128,11 @@ class Syncano
|
|
128
128
|
response = perform_save(nil)
|
129
129
|
|
130
130
|
if new_record?
|
131
|
-
|
132
|
-
|
131
|
+
response_data = ActiveSupport::HashWithIndifferentAccess.new(response.data)
|
132
|
+
created_object = self.class.new(client, self.class.map_to_scope_parameters(attributes).merge(response_data))
|
133
|
+
|
134
|
+
self.id = created_object.id
|
135
|
+
self.attributes.merge!(created_object.attributes)
|
133
136
|
mark_as_saved!
|
134
137
|
end
|
135
138
|
|
data/lib/syncano/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: syncano
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.1.1.
|
4
|
+
version: 3.1.1.beta5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Piotr Zadrożny
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-06-
|
11
|
+
date: 2014-06-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: jimson-client
|