diff --git a/lib/jsonapi/rails.rb b/lib/jsonapi/rails.rb index 43fd8c5..47954f9 100644 --- a/lib/jsonapi/rails.rb +++ b/lib/jsonapi/rails.rb @@ -37,7 +37,7 @@ def self.install! # @return [NilClass] def self.add_errors_renderer! ActionController::Renderers.add(:jsonapi_errors) do |resource, options| - self.content_type ||= Mime[:jsonapi] + self.content_type = Mime[:jsonapi] if self.media_type.nil? many = JSONAPI::Rails.is_collection?(resource, options[:is_collection]) resource = [resource] unless many @@ -90,7 +90,7 @@ def self.add_errors_renderer! # @return [NilClass] def self.add_renderer! ActionController::Renderers.add(:jsonapi) do |resource, options| - self.content_type ||= Mime[:jsonapi] + self.content_type = Mime[:jsonapi] if self.media_type.nil? JSONAPI_METHODS_MAPPING.to_a[0..1].each do |opt, method_name| next unless respond_to?(method_name, true)