Sha256: 48ed9494804e7a6ddbf9ea02602199b8e0b620221fa0cd218756a51ec7779faf

Contents?: true

Size: 380 Bytes

Versions: 28

Compression:

Stored size: 380 Bytes

Contents

$:.push 'examples'; require 'helper'

class Root < RestModel
  property :id
  embeds_one :item, if: proc {id == "1"}
end

class Item < RestModel
  property :id
end

@root_with_item = Root.from_source!(id: 1, item: {id: 2000}).first
inspect_rest_model(@root_with_item)

@root_without_item = Root.from_source!(id: 100, item: {id: 2000}).first
inspect_rest_model(@root_without_item)

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rest_model-0.1.9 examples/embeds_one/with_if.rb
rest_model-0.1.8 examples/embeds_one/with_if.rb
rest_model-0.1.7 examples/embeds_one/with_if.rb
rest_model-0.1.6 examples/embeds_one/with_if.rb
rest_model-0.1.5 examples/embeds_one/with_if.rb
rest_model-0.1.4 examples/embeds_one/with_if.rb
rest_model-0.1.3 examples/embeds_one/with_if.rb
rest_model-0.1.2 examples/embeds_one/with_if.rb