I prefer to use acting_user.id == user.id instead of acting_user ==
user.   The way that rails works it isn't necessarily guaranteed that
two elements that occupy the same row in the database necessarily end
up instantiated as the same object, especially since acting_user may
have come from your session instead of the database.

Bryan


On Wed, Aug 22, 2012 at 9:29 AM, tomkins <[email protected]> wrote:
> I uploaded a different database that has the same structure but different
> data than the old database, and the remove button in a table has stopped
> working. It removes the item from the table but when I refresh the page it
> returns. I looked into the logs and I can see Hobo: Permission Denied!
> This is my destroy_permitted? function:
>
>   def destroy_permitted?
>     acting_user == user or acting_user.administrator?
>   end
>
> When I change the acting user to administrator it works, but when the acting
> user == user it gives Permission Denied, which it did not do with the old
> database.
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Hobo Users" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/hobousers/-/Hq83iyGMlK0J.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/hobousers?hl=en.

-- 
You received this message because you are subscribed to the Google Groups "Hobo 
Users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/hobousers?hl=en.

Reply via email to