Skip to content

Instantly share code, notes, and snippets.

@MarkMenard
Created November 12, 2009 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarkMenard/232816 to your computer and use it in GitHub Desktop.
Save MarkMenard/232816 to your computer and use it in GitHub Desktop.
class Post < ActiveRecord::Base
end
class RatingEvent < ActiveRecord::Base
end
class PostRatingObserver < ActiveRecord::Base
observer :post
def after_save
# Create a RatingEvent appropriate for Post
# Adjust user's rating, etc.
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment