jarektkaczyk / revisionable

Nice and easy way to handle revisions of your db
http://softonsofa.com
MIT License
259 stars 43 forks source link

user_id is saved as -- even if the user is logged in #39

Closed nikhileshva closed 9 years ago

nikhileshva commented 9 years ago

Even after the user is logged in, the user_id column saves -- instead of user_id

jarektkaczyk commented 9 years ago

Share your implementation details. It saves the user correctly, but you may need to chooce the field.

nikhileshva commented 9 years ago

Out of the 2000 revisions made by 6 Models, this scenario was noted only thrice. Not every entry is -- . So, I am guessing it only happens when the session has expired and user made an activity during that.

jarektkaczyk commented 9 years ago

Seems odd that logged-out (session expired) user is able to make any changes. I don't think revisionable can do anything about that.

nikhileshva commented 9 years ago

But the point is why revisions are made even if the session has expired?

jarektkaczyk commented 9 years ago

It's up to your app to stop the process in this case. The package doesn't do anything unless created/updated/restored/deleted event on the model actually happened. That said, you need to revise your flow and make sure nothing is saved to the database prior to the redirect (or anything that you are doing in case of session expiration).