Sorry, I thought that it were a good idea to raise an exception for
debugging purposes, but in this case ActiveRecord rollback mechanism
resets the object, that I wanted to debug.

What I wanted to achieve - setting an active record objects company id
to that of the acting_user, when saving - can be easily achieved by
e.g.:

class Address
  hobo_model
  ...
  before_save{|adr|
    adr.company_id = adr.acting_user.company_id
  }

Regards, Bernhard


On 29 Jun., 15:14, Bernhard Leicher <[email protected]>
wrote:
> Hi everybody,
>
> just for debugging purposes I put this in a Hobo Model:
>
> class Address < ActiveRecord::Base
>  ...
>  before_update{|adr|
>     raise adr.acting_user.inspect
>   }
>   ...
> and it gives me nil for the acting_user! I tried other callbacks like
> before_save, same result.
> Can anyone shed some light on this?
>
> Regards, Bernhard

-- 
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