On Feb 23, 2:13 am, Philipp Kursawe <[email protected]> wrote:
> Hello,
>
> I love DM but this issue is driving me crazy:
>
> after :create do |license|
>   if 0 == Slot.import_legacy(license.id)
>     license.create_slots
>   end
> end
>
> This hook is never called. Neither with License.new.save  nor with
> License.create
> The license object is saved but the hook is not called.

It's hard to say why it doesn't work just from this little snippet of
code. A stand-alone script reproducing the problem would be great
but...

>
> Any ideas or workarounds?

...don't use hooks. If you need license instance to create slots then
just override #create, call super and do your thing there if creation
was successful.

Cheers!

# solnic

-- 
You received this message because you are subscribed to the Google Groups 
"DataMapper" 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/datamapper?hl=en.

Reply via email to