@@ -122,7 +122,7 @@ def parse_modify_relationship_action(params, modification_type)
122122 if data_required
123123 data = params . fetch ( :data )
124124 object_params = { relationships : { format_key ( relationship . name ) => { data : data } } }
125- verified_params = parse_params ( object_params , updatable_fields )
125+ verified_params = parse_params ( object_params , @resource_klass . updatable_fields ( @context ) )
126126
127127 parse_arguments = [ verified_params , relationship , parent_key ]
128128 else
@@ -346,22 +346,11 @@ def add_show_related_resources_operation(relationship_type)
346346 )
347347 end
348348
349- # TODO: Please remove after `createable_fields` is removed
350- # :nocov:
351- def creatable_fields
352- if @resource_klass . respond_to? ( :createable_fields )
353- creatable_fields = @resource_klass . createable_fields ( @context )
354- else
355- creatable_fields = @resource_klass . creatable_fields ( @context )
356- end
357- end
358- # :nocov:
359-
360349 def parse_add_operation ( data )
361350 Array . wrap ( data ) . each do |params |
362351 verify_type ( params [ :type ] )
363352
364- data = parse_params ( params , creatable_fields )
353+ data = parse_params ( params , @resource_klass . creatable_fields ( @context ) )
365354 @operations . push JSONAPI ::Operation . new ( :create_resource ,
366355 @resource_klass ,
367356 context : @context ,
@@ -567,17 +556,6 @@ def verify_permitted_params(params, allowed_fields)
567556 end
568557 end
569558
570- # TODO: Please remove after `updateable_fields` is removed
571- # :nocov:
572- def updatable_fields
573- if @resource_klass . respond_to? ( :updateable_fields )
574- @resource_klass . updateable_fields ( @context )
575- else
576- @resource_klass . updatable_fields ( @context )
577- end
578- end
579- # :nocov:
580-
581559 def parse_add_relationship_operation ( verified_params , relationship , parent_key )
582560 if relationship . is_a? ( JSONAPI ::Relationship ::ToMany )
583561 @operations . push JSONAPI ::Operation . new ( :create_to_many_relationship ,
@@ -634,7 +612,7 @@ def parse_single_replace_operation(data, keys, id_key_presence_check_required: t
634612 @resource_klass ,
635613 context : @context ,
636614 resource_id : key ,
637- data : parse_params ( data , updatable_fields ) ,
615+ data : parse_params ( data , @resource_klass . updatable_fields ( @context ) ) ,
638616 fields : @fields ,
639617 include_directives : @include_directives
640618 )
0 commit comments