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

User options and deeply nested representers #145

Closed
AndrewSwerlick opened this issue Aug 12, 2015 · 3 comments
Closed

User options and deeply nested representers #145

AndrewSwerlick opened this issue Aug 12, 2015 · 3 comments

Comments

@AndrewSwerlick
Copy link

I have a fairly deeply nested set of representers that looks something like this pseudo code

Survey do 
  collection SurveyComponents do 
    property Deliverable do 
      collection Questions
    end
  end

end

(Note in reality each representer is broken out into a seperate file, but I'm simplifying it here to describe the issue).

At the Deliverable level, I need to potentially randomize the order of the questions for each user, but keep the order the consistent every time a given user views them. I do that by having the deliverable representer receive a random seed based on the user id. However, when I'm trying to run Survey.to_json(random_seed: user.id) that random seed arg is not being passed along to the nested deliverables. The documentation seems to suggest that user options will be based along to nested representers, but is that limited to immediate children, or am I doing something wrong?

@apotonick
Copy link
Member

Hm, that doesn't sound right, let me take a look at this. Options should be passed on every level.

@apotonick
Copy link
Member

I wrote some more tests, and it looks as if you're doing something wrong. Any code for us?

@AndrewSwerlick
Copy link
Author

Sorry just got back from vacation. Give me a day to dig out and I'll have
something.

~Andrew S.

On Thu, Aug 13, 2015 at 12:59 AM, Nick Sutterer notifications@github.com
wrote:

I wrote some more tests, and it looks as if you're doing something wrong.
Any code for use?


Reply to this email directly or view it on GitHub
#145 (comment)
.

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

2 participants