Git Product home page Git Product logo

Comments (10)

namick avatar namick commented on July 19, 2024

I'm not sure I have enough information to help you debug that. Do you have the full app on github somewhere? Can you write a failing test?

from obfuscate_id.

Znow avatar Znow commented on July 19, 2024

Yes, but its private, what do you need from it?

Not at the moment.

from obfuscate_id.

namick avatar namick commented on July 19, 2024

What does your ActiveRecord finder code look like?

from obfuscate_id.

Znow avatar Znow commented on July 19, 2024

Pretty standard: @meter = Meter.find(params[:id]) this you mean?

from obfuscate_id.

namick avatar namick commented on July 19, 2024

As far as I can tell, your error here:

Couldn't find Meter with id=2890815067 [WHERE "meters"."signup_id" = 4]

is showing a slightly more complicated finder or scope. You are querying for a specific meter (with the obfuscated_id of that meter).

It is hard to tell why this would be without looking at your code.

By the time the id reaches the database, it needs to be converted back from its obfuscated form.

I'll see if I can whip up an example app showing usage of obfuscate_id with nested routes.

from obfuscate_id.

Znow avatar Znow commented on July 19, 2024

Ive just followed your guide, no special setup, nothing extraordinary.

from obfuscate_id.

namick avatar namick commented on July 19, 2024

Hard to debug this without seeing your code.

I put together an example app with 3 levels of nested resources and it is working for me. What version of Rails are you using?

I'll put up the sample app in a bit here...

from obfuscate_id.

namick avatar namick commented on July 19, 2024

I put up an example app with nested resources using obfuscate_id. These tests all pass:

https://github.com/namick/deeply-nested-resources/blob/master/spec/features/nested_spec.rb

One thing to think about is that you shouldn't need to scope your meter by its id and signup_id since the id is already unique.

Check out the changes needed to make to generated scaffolding work with nesting.

namick/deeply-nested-resources@1d8a7b4

You may be able to find something in there to help.

Feel free to close this issue unless you still think it is a problem with obfuscate_id

Also, if you want to give me access to your repo, I'm happy to help you debug it. :-)

from obfuscate_id.

namick avatar namick commented on July 19, 2024

Now that we have determined that this is not a problem with obfuscate_id, I am going to close this while I help you with your app via email.

from obfuscate_id.

Znow avatar Znow commented on July 19, 2024

Hi Nathan,

sorry for the delay on my respond, been abit off.

Ive looked at your commit:
namick/deeply-nested-resources@1d8a7b4

and did the same stuff at the signups_controller.rb as youve described:

ActiveRecord::RecordNotFound in MetersController#edit

Couldn't find Meter with id=7526016981 [WHERE "meters"."deleted_at" IS
NULL AND "meters"."signup_id" = 4]

Ive updated my code:

https://github.com/Znow/energi/tree/master/app/controllers

2013/4/21 nathan amick [email protected]

Now that we have determined that this is not a problem with obfuscate_id,
I am going to close this while I help you with your app via email.


Reply to this email directly or view it on GitHubhttps://github.com//issues/6#issuecomment-16715062
.

from obfuscate_id.

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.