jsonapi-resources 0.0.2 → 0.0.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5eb2793fc0bf0e02a6224a77143049fb497b7fcb
4
- data.tar.gz: 9e4af0e18b535c6bb61252f3e6b7f4d6c45d55d8
3
+ metadata.gz: f19bd8952d6f9ad375cdd0771b95ea66b7f58bd4
4
+ data.tar.gz: 0f3ee0a42a392f2f3569997473b1f504618a3d06
5
5
  SHA512:
6
- metadata.gz: e93a730c3e5fbc508463c16a4cf54553697d2307b99bc320850b1486a6d312795ed56b1c4aba89075b3523317ffe64b85167cc8c0e748c9819f6923e97711a2e
7
- data.tar.gz: 98b86070d30b544ecf95398956a92c84200d25867323467d3f0bd1cd591b2456a7b9015b592d84899f5936f885858f252d8756643f76ecf8e32352ba702637ec
6
+ metadata.gz: 91600fddbd75792442e535374e131e878a133f087bc74103c41e6cf439c666657e9b6ed2b3c5abfbaf350b28b678acceb5a39b4b0050a31be553f844d83d951c
7
+ data.tar.gz: 4699a968d96300ca0b24174ba308d7fcddf973b2fb4f93dd0693c5d39294804eaee80cf46158964752d371c1179d4c695ab2b447ba584c659d4902c98abeb2e3
@@ -22,7 +22,7 @@ module JSONAPI
22
22
  def apply(context)
23
23
  resource = @resource_klass.new
24
24
  resource.replace_fields(@values, context)
25
- resource.save
25
+ resource.save(context)
26
26
 
27
27
  return JSONAPI::OperationResult.new(:created, resource)
28
28
 
@@ -64,7 +64,7 @@ module JSONAPI
64
64
  def apply(context)
65
65
  resource = @resource_klass.find_by_key(@resource_id, context)
66
66
  resource.replace_fields(values, context)
67
- resource.save
67
+ resource.save(context)
68
68
 
69
69
  return JSONAPI::OperationResult.new(:ok, resource)
70
70
 
@@ -86,7 +86,7 @@ module JSONAPI
86
86
  def apply(context)
87
87
  resource = @resource_klass.find_by_key(@resource_id, context)
88
88
  resource.replace_has_one_link(@association_type, @key_value, context)
89
- resource.save
89
+ resource.save(context)
90
90
 
91
91
  return JSONAPI::OperationResult.new(:created, resource)
92
92
  end
@@ -143,7 +143,7 @@ module JSONAPI
143
143
  def apply(context)
144
144
  resource = @resource_klass.find_by_key(@resource_id, context)
145
145
  resource.remove_has_one_link(@association_type, context)
146
- resource.save
146
+ resource.save(context)
147
147
 
148
148
  return JSONAPI::OperationResult.new(:no_content)
149
149
  end
@@ -71,7 +71,7 @@ module JSONAPI
71
71
  end if field_data[:has_many]
72
72
  end
73
73
 
74
- def save
74
+ def save(context)
75
75
  @object.save!
76
76
  rescue ActiveRecord::RecordInvalid => e
77
77
  errors = []
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Resources
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi-resources
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Gebhardt
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-22 00:00:00.000000000 Z
12
+ date: 2014-08-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler