Skip to content
This repository has been archived by the owner on May 9, 2019. It is now read-only.

callbacks

Florian Kasper edited this page Aug 30, 2013 · 3 revisions

There are several callbacks on following actions:

  • update
  • save
  • delete (will be destroy in upcomming release)
  • initialize

To use these callbacks just use the "rails" way:

class Page < GollumRails::Page

    after_save :update_something

    def update_something
      do_stuff
    end

end

You can also use whole classes, which respond to these callbacks:

class Callbacks

  def self.after_save(object)
    object.do_something
  end

end

class Page < GollumRails::Page

    after_save Callbacks

end

where object is the current instance of Page.

There are two types of callbacks:

  • before_* .
  • after_* .

Each of the above named actions has these types of callbacks.

Clone this wiki locally