jsonapi-resources 0.8.1 → 0.8.2

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.
@@ -201,7 +201,7 @@ module JSONAPI
201
201
  relationship = resource_klass._relationship(relationship_name)
202
202
  if relationship && format_key(relationship_name) == include_parts.first
203
203
  unless include_parts.last.empty?
204
- check_include(Resource.resource_for(@resource_klass.module_path + relationship.class_name.to_s.underscore), include_parts.last.partition('.'))
204
+ check_include(Resource.resource_for(resource_klass.module_path + relationship.class_name.to_s.underscore), include_parts.last.partition('.'))
205
205
  end
206
206
  else
207
207
  @errors.concat(JSONAPI::Exceptions::InvalidInclude.new(format_key(resource_klass._type),
@@ -1,5 +1,5 @@
1
1
  module JSONAPI
2
2
  module Resources
3
- VERSION = '0.8.1'
3
+ VERSION = '0.8.2'
4
4
  end
5
5
  end
@@ -32,6 +32,12 @@ module ActionDispatch
32
32
  options[:except] = [:new, :edit]
33
33
  end
34
34
 
35
+ if res._immutable
36
+ options[:except] << :create unless options[:except].include?(:create) || options[:except].include?('create')
37
+ options[:except] << :update unless options[:except].include?(:update) || options[:except].include?('update')
38
+ options[:except] << :destroy unless options[:except].include?(:destroy) || options[:except].include?('destroy')
39
+ end
40
+
35
41
  resource @resource_type, options do
36
42
  # :nocov:
37
43
  if @scope.respond_to? :[]=
@@ -96,9 +102,9 @@ module ActionDispatch
96
102
  end
97
103
 
98
104
  if res._immutable
99
- options[:except] << :create
100
- options[:except] << :update
101
- options[:except] << :destroy
105
+ options[:except] << :create unless options[:except].include?(:create) || options[:except].include?('create')
106
+ options[:except] << :update unless options[:except].include?(:update) || options[:except].include?('update')
107
+ options[:except] << :destroy unless options[:except].include?(:destroy) || options[:except].include?('destroy')
102
108
  end
103
109
 
104
110
  resources @resource_type, options do
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.8.1
4
+ version: 0.8.2
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: 2016-10-05 00:00:00.000000000 Z
12
+ date: 2017-01-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -201,7 +201,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
201
201
  version: '0'
202
202
  requirements: []
203
203
  rubyforge_project:
204
- rubygems_version: 2.5.1
204
+ rubygems_version: 2.6.8
205
205
  signing_key:
206
206
  specification_version: 4
207
207
  summary: Easily support JSON API in Rails.