active_model_serializers/lib/active_model/serializer/adapter/null.rb
Benjamin Fleischer 2d24dded14 serializable_hash and as_json should take options = nil
per ActiveModel::Serialization#serializable_hash
96bb004fc6/activemodel/lib/active_model/serialization.rb
    def serializable_hash(options = nil)
          options ||= {}

Otherwise, passing in nil to `as_json` or `serializable_hash`
makes things blow up when passing nil into attributes
2015-06-24 11:46:29 -05:00

12 lines
181 B
Ruby

module ActiveModel
class Serializer
class Adapter
class Null < Adapter
def serializable_hash(options = nil)
{}
end
end
end
end
end