Refactoring: Agora o sistema se comporta bem com objetos excluidos

This commit is contained in:
2008-03-15 07:44:46 -03:00
parent 8d02e0d4ce
commit 4c55ce7b45
16 changed files with 114 additions and 96 deletions

View File

@@ -15,28 +15,19 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
class Message < ActiveRecord::Base
# Plugins
acts_as_paranoid
belongs_to :user, :foreign_key => "sender_id"
# Associacoes
belongs_to :user,
:foreign_key => "sender_id",
:with_deleted => true
end
class PrivateMessage < Message
end
class News < Message
validates_presence_of :title
belongs_to :course, :foreign_key => "receiver_id"
end
class ShoutboxMessage < Message
end
class CourseShoutboxMessage < ShoutboxMessage
end
class UserShoutboxMessage < ShoutboxMessage
belongs_to :course,
:foreign_key => "receiver_id"
end