You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
current version (0.10.0) will fail when using the block with the following error:
undefined method `setup' for ActiveModel::Serializer:Class (NoMethodError)
well, the AMS version 0.8, 0.9, and 0.10 are all incompatible, so I'd argue it's the job of any gem supporting multiple versions to put any necessary conditionals in there.
since config is essentially a hash, you could also just config.merge!
bf4
changed the title
Initializer syntax changing back and forth
ActiveModel::Serializer.setup(&config) not present in 0.10; causes failures in integrated gems
Jun 2, 2016
Thanks. So in order to fix devise_token_auth I could just check if the ActiveModel::Serializer class responds to setup or config and configure accordingly?
It seems this issue has been changing back and forth.
Previous versions of AMS can be configured with this block in the initializer:
ActiveModel::Serializer.setup do |config|
config.adapter == :json_api
end
as opposed to the way indicate in the latest documentation:
ActiveModelSerializers.config.adapter = :json_api # Default:
:attributes
current version (0.10.0) will fail when using the block with the following error:
undefined method `setup' for ActiveModel::Serializer:Class (NoMethodError)
The change is breaking integrations with other gems (like devise_token_auth see lynndylanhurley/devise_token_auth#644)
Is there a definitive answer to the proper syntax?
The text was updated successfully, but these errors were encountered: