-
Notifications
You must be signed in to change notification settings - Fork 35
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
Has_many method 'xxx_ids' #35
Comments
@BorisBresciani I can add support for wdyt? |
It is a good idea or if not to do as simple attributes without specifying "has_many" like my example |
It's simple to do I have two options to tackle this:
Both solutions will take some time to develop if you can wait two weeks (at max), I will implement them now and in the meanwhile you will do: attributes :panko_ids
def panko_ids
object.panko_ids
end or attributes :panko_ids
delegate :panko_ids to: :object |
Hi, The second solution seems better |
Hello,
Variables of type 'xxx_ids' (has_many) built automatically by ActiveRecord do not work in attributes mode
Exemple:
This example works
Model:
Serializer:
###############
This example does not work
Model:
Serializer:
However the variable
panko_ids
is well regarded as an attribute because I can dorecord.panko_ids
orrecord.send(:panko_ids)
Ruby: 2.5.1
Rails: 5.2.1
Thx :)
The text was updated successfully, but these errors were encountered: