Comments (10)
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.
Yes, but its private, what do you need from it?
Not at the moment.
from obfuscate_id.
What does your ActiveRecord finder code look like?
from obfuscate_id.
Pretty standard: @meter = Meter.find(params[:id]) this you mean?
from obfuscate_id.
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.
Ive just followed your guide, no special setup, nothing extraordinary.
from obfuscate_id.
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.
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.
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.
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)
- Breaks when upgrading to Rails 4.1 HOT 3
- Having obfuscate_id in more than one model causes a error. HOT 5
- Updating model with update_attribute doesn't work HOT 5
- Bug on batch actions with ActiveAdmin HOT 1
- reload no longer works HOT 1
- Don't compatible with Rails 4 HOT 18
- Speed for API HOT 1
- Rails 4.2: Unable to use obfuscate_id :spin => 89238723 HOT 4
- Any plan to obfuscate with nice Hashids HOT 3
- RecordNotFound error when using ActionMailer's deliver_later method HOT 9
- bignum too big to convert into `long'
- Unable to find model with obfuscated ID via a has_many / through association HOT 7
- Describe the security limitation? HOT 2
- class.find_by() not working HOT 1
- Gem not working with Rails 5 HOT 5
- Obfuscate an ActiveRecord collection
- Can not `lock!`an ActiveRecord instance HOT 1
- Access methods to deobfuscate the ID HOT 1
- ActiveRecord::RecordNotFound: Couldn't find User with an out of range ID
- Is this gem still alive?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from obfuscate_id.