diff options
author | francis <francis> | 2007-09-10 18:58:42 +0000 |
---|---|---|
committer | francis <francis> | 2007-09-10 18:58:42 +0000 |
commit | 2f61ce926c4311ff95597c1c871081a1fb46a4d6 (patch) | |
tree | e59a0e989b31e51a6069c8426840ec4db95dc26b /app/models/outgoing_message.rb | |
parent | 022f7a0d72a7742875d9ba94ce33a4ec069d36dd (diff) |
Model for outgoing messages.
Save body of initial request as an outgoing message.
Try and validate and save the pair of models correctly.
Diffstat (limited to 'app/models/outgoing_message.rb')
-rw-r--r-- | app/models/outgoing_message.rb | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb new file mode 100644 index 000000000..186bb2147 --- /dev/null +++ b/app/models/outgoing_message.rb @@ -0,0 +1,23 @@ +# models/outgoing_message.rb: +# A message, associated with a request, from the user of the site to somebody +# else. e.g. An initial request for information, or a complaint. +# +# Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. +# Email: francis@mysociety.org; WWW: http://www.mysociety.org/ +# +# $Id: outgoing_message.rb,v 1.1 2007-09-10 18:58:43 francis Exp $ + +class OutgoingMessage < ActiveRecord::Base + belongs_to :info_request + validates_presence_of :info_request_id + + validates_presence_of :body + validates_inclusion_of :status, :in => ['ready', 'sent', 'failed'] + + belongs_to :public_body + validates_inclusion_of :message_type, :in => ['initial_request'] #, 'complaint'] + + belongs_to :recipient, :polymorphic => true + +end + |