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: 70bce66a73cd3621f2d72c1154445a1709ae1f7a
4
- data.tar.gz: 47e69f869c71213922942d8829a667fc3672e385
3
+ metadata.gz: 5632c813fe24e80cba23e110e5005c335dadfd13
4
+ data.tar.gz: d37ecf72ae8cffe91d34d5564757cfff18c47662
5
5
  SHA512:
6
- metadata.gz: db930d612f78f8110444109d50d4a5c91e435b25e68ef326413dc3693c2b234df5eae7dbbfeeb20977aca384def20a9664010b64e17fad881a4e3ffbbbe743af
7
- data.tar.gz: a25a72c433d76bd820a3b074c4e347c7cf54a1a8884500db4ca7bbd2d778165ef517120e9376be8c2c86cbc11bfbebb6fee86a618f40dd79700b59188817fd2c
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
- record = @initialize(obj,{klass: klass})
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)->
@@ -1,3 +1,3 @@
1
1
  module MaterialRaingular
2
- VERSION = "0.5.9"
2
+ VERSION = "0.6.0"
3
3
  end
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.5.9
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-02-24 00:00:00.000000000 Z
11
+ date: 2017-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler