-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Issues with active_model_serializers #644
Comments
Not sure if this is related but I have since updated my Active model serializer gem and suddenly the client authentication header is now default. |
@virginia-rodriguez I had this issue, and solved it by specifying version e.g. |
I am getting a related error on sign-in / sign-up: NoMethodError (undefined method `setup' for ActiveModel::Serializer:Class): /home/augusto/.rvm/gems/ruby-2.3.0@faces/bundler/gems/devise_token_auth-81fc7b40998d/app/controllers/devise_token_auth/application_controller.rb:38:in `is_json_api' I have the following in my gem file: gem 'devise' Any ideas? Edit: I found this commit in master branch from 7 days ago which breaks things for me: Why is this block not working for me? 38 return ActiveModel::Serializer.setup do |config| Edit 2: It seems ActiveModel::Serializer respond_to? config but not to setup. |
It turns out the setup block configuration method introduced in 7b97279 commit is not compatible with current 0.10.0 version of Active Model Serializer. I'll patch in a conditional and submit a PR soon. |
i'll merge that PR whenever you get a chance @augustosamame -- the state of things in AMS is kinda confusing these days. |
@augustosamame just submit a revert of #648 and all will be well |
@booleanbetrayal nah, it's pretty simple
myself |
github has made it super-easy to revert without typing, which is what i just did via #652 |
a revert won't do since it will break compatibility with AMS 0.9.2 |
Should be resolved as of #651 ... Please verify as I don't have access to my dev env atm. |
@woodcrust beat me to it Confirmed issue is resolved as of #651 . |
I was using active_model_serializers 0.9.5 with last released version of devise_token_auth (0.1.37) and everything worked fine. Then I tried to use devise_token_auth master branch to use a fix that was present there. But other changes introduced to master branch cause devise_token_auth to stop working properly (ex. sign in is broken). An exception is raised in https://github.com/lynndylanhurley/devise_token_auth/blob/master/app/controllers/devise_token_auth/application_controller.rb#L38, because ActiveModel::Serializer config is not defined.
NoMethodError (undefined method 'config' for ActiveModel::Serializer:Class):
Also, since devise_token_auth seems to be having some issues with last version of active_model_serializers (see #600), why force to use last version?
What about just replacing the conflictive line with:
ActiveModel::Serializer.respond_to?(:config) && ActiveModel::Serializer.config.adapter == :json_api
Anyone is having similar issues?
The text was updated successfully, but these errors were encountered: