proxima 2.1.1 → 2.2.0
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/lib/proxima/model.rb +5 -5
- data/lib/proxima/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 172add0db2041ab0e2d4ca1fc8640661af86de23
|
4
|
+
data.tar.gz: e96625b4fc91d708093752f3c6cc74b743003808
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abc938c70b64a424b8af37cf751d4aa12c26183c595919fc156c890feca7e3101ae454b89c4e332e7a9952e0238e84d8f70834494b670d07fb696d5c8c431d9a
|
7
|
+
data.tar.gz: fb26576b44949f52cde4c68ba4213b3c16ae8dcd795835a1d8fb0497daece7d33e094ac18fb7c9f8ffc355c932470238cb1a0c16e7fecb416f526a94afa75ad7
|
data/lib/proxima/model.rb
CHANGED
@@ -122,26 +122,26 @@ module Proxima
|
|
122
122
|
@response
|
123
123
|
end
|
124
124
|
|
125
|
-
def save(
|
125
|
+
def save(opts = {}, params = {})
|
126
126
|
return false unless self.valid?
|
127
127
|
|
128
128
|
if self.new_record?
|
129
129
|
path = self.class.create_path.call self.to_h
|
130
|
-
payload = { json: self.as_json(
|
130
|
+
payload = { json: self.as_json(opts) }
|
131
131
|
@response = self.class.api.post path, payload
|
132
132
|
|
133
133
|
return false unless @response.code == 201
|
134
134
|
|
135
|
-
self.from_json @response.body,
|
135
|
+
self.from_json @response.body, opts
|
136
136
|
self.new_record = false
|
137
137
|
return true
|
138
138
|
end
|
139
139
|
|
140
140
|
return true if self.persisted?
|
141
141
|
|
142
|
-
|
142
|
+
opts[:flatten] = true if opts[:flatten] == nil
|
143
143
|
path = self.class.update_by_id_path.call params.merge(self.to_h)
|
144
|
-
payload = { json: self.as_json(
|
144
|
+
payload = { json: self.as_json(opts) }
|
145
145
|
@response = self.class.api.put path, payload
|
146
146
|
|
147
147
|
return false unless @response.code == 204
|
data/lib/proxima/version.rb
CHANGED