You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Dynamoid relies on ActiveModel to do the serialisation of Document objects. This should allow us to filter document attributes via a custom as_json method, when a document is serialised to JSON. Eg:
class MyDocument
include Dynamoid::Document
...
def as_json(options = {})
super(options.merge(except: [:id]))
end
Unfortunately, this doesn't work as expected because ActiveModel::Serialization.serializable_hash expects attributes.keys to return an array of strings, not symbols:
Dynamoid relies on ActiveModel to do the serialisation of Document objects. This should allow us to filter document attributes via a custom
as_json
method, when a document is serialised to JSON. Eg:Unfortunately, this doesn't work as expected because
ActiveModel::Serialization.serializable_hash
expectsattributes.keys
to return an array of strings, not symbols:The text was updated successfully, but these errors were encountered: