-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Relationships with ActiveModelSerializers::Model #1961
Comments
What is the output of |
It is It looks like I'm having problems with My model has been updated to the following: class User::Registration < ActiveModelSerializers::Model
include ActiveModel::Model
include ActiveModel::Serialization
end
|
As far as I can tell, you're not setting the user, so I do not understand why it would be surprising that the |
It's set in the |
As far as I can tell it is never called though. |
Oops – it is indeed called in the |
What is the value of |
It's a |
I guess this is related to #1953. @andrewferk you are right in #1961 (comment). When |
@andrewferk This is a known bug in AMS::Model that no one has fixed yet. see #1903 until it is fixed, you can either roll your own poro, using AMS::Model as a reference doc (which is part of its intention), or call |
Looks like I've implemented a good chunk of this in #1984 |
@bf4 Sorry, I did some digging but still not quite sure if this has been fixed or not by your pull request |
Also see active_model_serializers/test/fixtures/poro.rb Lines 6 to 26 in 3c5e11b
|
I'm using version 0.10.2 and attempting to create a relationship (
belongs_to
) withActiveModelSerializers::Model
(and notActiveRecord::Model
). The relationship output keeps returning null.Thanks!
Model
Resource
Controller
Ouptut
I'd expect the relationships output to not be null.
The text was updated successfully, but these errors were encountered: