jsonapi-deserializable/lib/jsonapi/deserializable/relationship/dsl.rb
Lucas Hosseini 538e09c5b3 Configurable deserialization + reverse mapping (#10)
* Deserialize all fields.
* Make blocks return hash instead of using fields method.
* Ensure valid payload.
* Make reverse mapping available.
2016-11-27 03:56:42 +01:00

16 lines
264 B
Ruby

module JSONAPI
module Deserializable
class Relationship
module DSL
def has_one(&block)
self.has_one_block = block
end
def has_many(&block)
self.has_many_block = block
end
end
end
end
end