unfortunately when i restart the branch to fix the style, i got the same error Robert got already here.
u (user) object in js doesn’t get
:name is added to
basic_user_serialize.rb error is raised.
I personally think the error is coming from these line of
if options[:include] == nil
options[:include] = @options[:include].include?(name)
options[:include] = !@options[:exclude].include?(name)
Is possible that
options[:include] is never true, therefore is always false?
If i put
association = association_class.new(name, self, options)
node[association.key] = association.serialize_ids
if association.embed_in_root? && hash.nil?
# Don't raise an error!
elsif association.embed_in_root? && association.embeddable?
merge_association hash, association.root, association.serializables, unique_values
node[association.key] = association.serialize
and i check what’s inside
options i see
So my questions are:
- Is name correctly saved in options?
- I guess this Active Model Serialize it doesn’t pass attributes just to basic_user_serialize.
If it pass
name to other part of the app and there is successfully passed to the frontend, then the problem come from how the attribues is passed. Otherwise problem is coming from active model serialize.