Class: TranslationCms::Api::Requestor
- Inherits:
-
JsonApiClient::Query::Requestor
- Object
- JsonApiClient::Query::Requestor
- TranslationCms::Api::Requestor
- Defined in:
- lib/translation_cms/api/requestor.rb
Instance Method Summary collapse
-
#custom(method_name, options, params) ⇒ Object
overriden to remove extra params from associations for custom endpoint methods.
Instance Method Details
#custom(method_name, options, params) ⇒ Object
overriden to remove extra params from associations for custom endpoint methods
7 8 9 10 11 12 13 |
# File 'lib/translation_cms/api/requestor.rb', line 7 def custom(method_name, , params) path = resource_path(params) params.delete(klass.primary_key) path = File.join([path, .fetch(:path, method_name).to_s].reject(&:blank?)) klass.associations.each { |a| params.delete(a.param) } if klass.associations.present? request(.fetch(:request_method, :get), path, params) end |