[Nitro] Help with callbacks

Humber Aquino humberaquino at gmail.com
Thu Dec 22 14:41:22 EST 2005

Hi everyone! I'm having a problem defining callbacks.. i don't know if
this is a newbie question or something like that but i didn't found a

I want to define some callbacks to do some custom validations among
other things..
i started with the og callback example but it doesn't work.

require 'og'

class Post
    property :name, String

    def initialize(name)
      @name = name

    def og_post_insert(conn)
        puts 'Hey, a new post was just posted!'

    def og_post_insert
        puts 'Hey, a new post was just posted!'

 p = Post.create('Hello')
#No output

 p2 = Post.new('Bye')
#No output

Mi nitro version is 0.26

I tried the update callback too and nothing happened.. I also put
raise some exceptions to see if the callback is actually called.
Do i have to include some mixin? Or do something else?

Thanks for your time and help


More information about the Nitro-general mailing list