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
Serializer fails when used with class extending ActiveModel::Model #520
Comments
You active model subclass needs to include this module, https://github.com/rails/rails/blob/c4fb191a4cc246db849f7acf31bd7edb4664cca5/activemodel/lib/active_model/serialization.rb , so probably adding a |
That did the trick - could this be documented on the wiki / README? Generally the assumption when you |
It's in the README. |
In version 0.09, I added the above Same error. Tried this line too: |
@ZiaMM Please open a new issue (and check the docs) |
When I use AMS in my project, all 'real' AR models work fine with the serialisers, but there are 2 problems using it with a virtual model that inherits from ActiveModel::Model:
I have to specify it with
render json: foo, serializer: FooSerializer...
to make this work.Using AMS v0.8.1 on Rails 4.0.2 / Jruby 1.7.9
Is this just a bug in the way I am using AMS, or does it not yet support virtual models?
The text was updated successfully, but these errors were encountered: