-
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
Pass fields down from constructor (MERGED) #1287
Pass fields down from constructor (MERGED) #1287
Conversation
Could you expand on the reasons you think this is something we should have? |
@vasilakisfil As @bf4 explained, this is by design, the options are then split and adapter options are directed towards the adapter. |
Wait something you haven't understood obviously. Let's take it step by step. |
Ok then we need to fix 2 things:
|
|
About (1) if it's an adapter option, why #1286 fails ? |
@@ -9,6 +9,7 @@ def initialize(serializer, options = {}) | |||
|
|||
def serializable_hash(options = nil) | |||
options ||= {} | |||
options[:fields] = instance_options[:fields] if options[:fields].nil? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you mean options[:fields] ||= instance_options[:fields]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah that's better I will fix it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vasilakisfil let's finish this?
The actual bug about 1) is that the |
No that's another bug. See #1286 tests for the bug I am telling you. |
You are right, this should really be querying |
|
There are 2 bugs:
|
@beauby @NullVoxPopuli @vasilakisfil I just merged this but on review #1287 (comment) did I misunderstand the conversation? (It's late and I'm tired, so delegating thoughts) |
Passes down the fields option to the serializer from the constructor unless it's overridden.