Implements functionality for serializing all attributes when the attributes class method is invoked with no arguments.
Progress on implementing all attributes serialization support with Ac…
Finished support for serializing all attributes when the attributes c…
…lass method is invoked with no arguments in an ActiveModel::Serializer
Merge pull request #1 from bigastronaut/master
Finished support for serializing all attributes
+1. I need this since I want to serialize all attributs but one. So with this pr I can add every attribut and then using def attributes I can delete the only key I don't want.
I understand that this is unwieldy, but the whitelist behavior is important. Thank you anyway!
@mmosche2 if you really need to get all the attributes without defining them in the serializer, you can just delegate it to object.
class UserSerializer < ActiveModel::Serializer
delegate :attributes, to: :object
I have tested it on 0.8.1 and it seems to work for one object, I didn't tested when you have an ActiveRecord::Relation.
Does not work in 0.10