From d53c2b7971388026be5c42cd833f7e16781f2c18 Mon Sep 17 00:00:00 2001 From: nfoy Date: Tue, 22 Apr 2014 22:43:59 -0400 Subject: Figured out mailboxer for sending pms and updated individual message view. --- app/models/pm.rb | 14 ++++++++++++-- app/models/user.rb | 8 ++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'app/models') diff --git a/app/models/pm.rb b/app/models/pm.rb index 9fce2b3..3ebb69d 100644 --- a/app/models/pm.rb +++ b/app/models/pm.rb @@ -1,4 +1,14 @@ class Pm < ActiveRecord::Base - belongs_to :author - belongs_to :recipient + belongs_to :author, class_name: "User" + belongs_to :recipient, class_name: "User" + + def name + return current_user.name + end + +=begin + def mailboxer_email(email) + return current_user.email + end +=end end diff --git a/app/models/user.rb b/app/models/user.rb index aacd7b1..6118e2a 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -12,6 +12,14 @@ class User < ActiveRecord::Base acts_as_messageable + def name + return current_user.user_name + end + + def mailboxer_email(object) + return nil + end + before_save { self.email = email.downcase } before_save { self.user_name = user_name } -- cgit v1.2.3-2-g168b