GithubHelp home page GithubHelp logo

Comments (4)

myabc avatar myabc commented on July 20, 2024

From @apotonick on November 25, 2015 2:28

Does represented work for you? That's the official API!

from roar-jsonapi.

myabc avatar myabc commented on July 20, 2024

From @matheusca on November 27, 2015 17:35

I can't use represented as requester inside of has_one block, because when I used it, the represented is the instance of residence_address like example above.

from roar-jsonapi.

myabc avatar myabc commented on July 20, 2024

From @apotonick on December 1, 2015 1:41

That is correct behaviour.

The represented method refers to the currently rendered object, which is a residence_address in your case.

You can do represented.requester if that's what your data model allows. Alternatively, you can pass the requester as a :user_options to the block. Representable/Roar does not support accessing parent decorators right now (because that's data modelling and not representing). Let me think about that!

from roar-jsonapi.

myabc avatar myabc commented on July 20, 2024

From @apotonick on December 1, 2015 2:21

As this might be a common problem in JSON API, we could introduce a :parent_represented option, which'd work as follows.

link :self do |options|
  options[:parent_represented].id
end

from roar-jsonapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.