This class observes changes made to the Resources of the application and increses the revision number every time a change is made.
Methods
Public Instance methods
This method is called every time an object of the observed classes is deleted.
[ show source ]
# File app/models/revision_observer.rb, line 17
17: def after_destroy(record)
18: Configuration.increment_revision()
19: Feed.create(:action => 'deleted',
20: :actioned_at => record.updated_at,
21: :resource => record.class.to_s.downcase,
22: :value => Feed.extract_rss_value(record))
23: end
This method is called every time an object of the observed classes is saved.
[ show source ]
# File app/models/revision_observer.rb, line 8
8: def after_save(record)
9: Configuration.increment_revision()
10: Feed.create(:action => 'created',
11: :actioned_at => record.updated_at,
12: :resource => record.class.to_s.downcase,
13: :value => Feed.extract_rss_value(record))
14: end