mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-23 14:29:31 +00:00
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
12 lines
181 B
Ruby
12 lines
181 B
Ruby
module ActiveModel
|
|
class Serializer
|
|
class Adapter
|
|
class Null < Adapter
|
|
def serializable_hash(options = nil)
|
|
{}
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|