I don't believe acting_user is available outside permission methods
and those I suspect are getting the user passed to them sneakily.

You might want to try to hook that in on the permission method instead
where you'd got the acting_user defined and hobo will understand a
failure better.  The only caveat would be to make sure your use credit
method doesn't alter anything.  Then add an after_create hook to do
any alterations that might need to be done.

Alternative is to add an owner type association and use that for your
call instead of acting_user.

On Jul 19, 6:33 pm, oillio <[email protected]> wrote:
> I am trying to use acting_user in before_create, but it doesn't seem
> to exist.  I recall reading on here that it should.  Is that
> incorrect?
>
> This is my code:
> before_create { |record| acting_user.use_credit }
>
> Additionally, the use_credit function may return false (if the acting
> user does not have any credits).  In this case the creation should be
> canceled (which works correctly).  But Hobo doesn't get the message
> and acts as if the record was created.  Is there any way to send an
> error message to Hobo at this point to indicate the creation failed?
>
> Thanks
> -Dan
--~--~---------~--~----~------------~-------~--~----~
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