Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates config wrapper to conform with multiple versions of Active Model Serializers #653

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/controllers/devise_token_auth/application_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def resource_class(m=nil)

def is_json_api
return false unless defined?(ActiveModel::Serializer)
# 0.10.0 branch of ActiveModel:Serializer does not respond to :setup block. Use alternate syntax
return ActiveModel::Serializer.config.adapter == :json_api unless ActiveModel::Serializer.respond_to?(:setup)
return ActiveModel::Serializer.setup do |config|
config.adapter == :json_api
end
Expand Down