Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reference to the same relationship from two different fields? #64

Open
fsauter opened this issue Jul 16, 2017 · 0 comments
Open

Reference to the same relationship from two different fields? #64

fsauter opened this issue Jul 16, 2017 · 0 comments

Comments

@fsauter
Copy link

fsauter commented Jul 16, 2017

Hi guys,

following scenario: I have an item with two tax code fields - different names but same type (and maybe same record):

Item
    belongs_to :tax_code_sales, class_name: TaxCode
    belongs_to :tax_code_purchase, class_name: TaxCode

If I have an item that has for both fields the same tax code (same ID) and I call toJSONTree the tax_code_purchase field contains "[Circular]".

Is there a way to create a condition to allow a scenario like this?

I guess it's related to this line: Resource.js#L238 but before I dig into it.. do you have any ideas/hints/solutions?

Cheers Florian

@fsauter fsauter changed the title Use included twice? Reference to the same relationship from two different fields? Jul 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant