Skip to content
DataMapper plugin for observing Resources http://datamapper.org/
Ruby
Latest commit d6d0983 @solnic solnic Remove VERSION file

README.rdoc

README

DataMapper::Observer allows you to add callback hooks to many models. This is similar to observers in ActiveRecord.

Example:

class Adam

include DataMapper::Resource

property :id, Serial
property :name, String

end

class AdamObserver

include DataMapper::Observer

observe Adam

before :save do
  # log message
end

before :get_drunk do
  # eat something
end

after_class_method :unite do
  raise "Call for help!"
end

end

Something went wrong with that request. Please try again.