Sha256: e8c71773015d7ab6e6a257eee75836fd43a4af07d69351689267e38ca1e84a8b
Contents?: true
Size: 795 Bytes
Versions: 5
Compression:
Stored size: 795 Bytes
Contents
require 'rails/observers/active_model/observing' module ActiveResource module Observing def self.prepended(context) context.include ActiveModel::Observing end def create(*) notify_observers(:before_create) if result = super notify_observers(:after_create) end result end def save(*) notify_observers(:before_save) if result = super notify_observers(:after_save) end result end def update(*) notify_observers(:before_update) if result = super notify_observers(:after_update) end result end def destroy(*) notify_observers(:before_destroy) if result = super notify_observers(:after_destroy) end result end end end
Version data entries
5 entries across 4 versions & 3 rubygems