Module: RestPack::Serializer::Single::ClassMethods
- Defined in:
- lib/restpack_serializer/serializable/single.rb
Instance Method Summary collapse
Instance Method Details
#single(params = {}, scope = nil, context = {}) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/restpack_serializer/serializable/single.rb', line 5 def single(params = {}, scope = nil, context = {}) = RestPack::Serializer::Options.new(self, params, scope, context) model = .scope_with_filters.first return model ? self.as_json(model, context) : nil end |