Skip to content

Latest commit

 

History

History
54 lines (50 loc) · 665 Bytes

File metadata and controls

54 lines (50 loc) · 665 Bytes

Transforms

  • Add ability to exclude a column:
Extralite::Transform.new do
  {
    id: integer.identity,
    title: text,
    content: text,
    tags: [{
      id: integer.identity.skip,
      name: text
    }]
  }
end
#=>
[
  {
    id: 1,
    title: 'foo',
    content: 'bar',
    tags: [
      { name: 'baz' },
      { name: 'bug' }
    ]
  }
]
  • Can we get rid of the hash container?
Extralite::Transform.new do
  {
    id: integer.identity,
    title: text,
    content: text,
    _tag_id: skip,
    tags: [
      name: text
    ]
  }
end
#=>
[
  {
    id: 1,
    title: 'foo',
    content: 'bar',
    tags: [ 'baz', 'bug' ]
  }
]