material_raingular 0.5.9 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5632c813fe24e80cba23e110e5005c335dadfd13
|
4
|
+
data.tar.gz: d37ecf72ae8cffe91d34d5564757cfff18c47662
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 315b4bd193ccf112d2be450b14b658549573e00d999bae7fd2311ee7428c2e0c59986ae10474cc5691c1b94b1174d41629a5f095f46a2c033cbc5ff86079b1ac
|
7
|
+
data.tar.gz: 4bde853689ba7d9563cbbcdf09a16acebb9400403d9cd9dae0f918be12bbdbc97eb80fbca894c80bf56300a4d49ae0981170e9d404b15fa024347415ef2db167
|
@@ -12,9 +12,11 @@ class ActiveRecord.$Resource extends Module
|
|
12
12
|
record = new @(null,null,null,options)
|
13
13
|
record.$processResponse(data: resource)
|
14
14
|
return record
|
15
|
-
@_resourcify: (obj,klass) ->
|
15
|
+
@_resourcify: (obj,klass,options) ->
|
16
16
|
return if obj.$activeRecord
|
17
|
-
|
17
|
+
options ||= {}
|
18
|
+
options.klass = klass
|
19
|
+
record = @initialize(obj,options)
|
18
20
|
obj[key] = val for key,val of record
|
19
21
|
|
20
22
|
$deferProcessResponse: (response) ->
|
@@ -57,6 +59,7 @@ class ActiveRecord.$Resource extends Module
|
|
57
59
|
method = if @.id then 'put' else 'post'
|
58
60
|
params = {}
|
59
61
|
params[@_options.paramWrapper || @_defaultWrap()] = if @.id then @$paramSerializer.update(@) else @$paramSerializer.create(@)
|
62
|
+
@$beforeSave?(params)
|
60
63
|
@["$" + key + "_was"] = val for key,val of res
|
61
64
|
return @$http[method](@$updateUrl(),params).then(@$deferProcessResponse.bind(@))
|
62
65
|
$destroy: (callback,error)->
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: material_raingular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Moody
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|