Created
July 16, 2009 15:51
-
-
Save jamesgolick/148485 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Creditor | |
observes :message, :invokes => :use_credits, :on => :create | |
observes :conversation, :invokes => :use_credits, :on => :create | |
def use_credits(user) | |
# use credits | |
end | |
end | |
class Conversation < ActiveRecord::Base | |
belongs_to :creator, :class_name => "User" | |
belongs_to :receiver, :class_name => "User" | |
end | |
class Message < ActiveRecord::Base | |
belongs_to :author, :class_name => "User" | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment