summaryrefslogtreecommitdiff
path: root/app/models
diff options
context:
space:
mode:
authornfoy <nfoy@purdue.edu>2014-04-22 22:43:59 -0400
committernfoy <nfoy@purdue.edu>2014-04-22 22:43:59 -0400
commitd53c2b7971388026be5c42cd833f7e16781f2c18 (patch)
tree90e5946dc5dbdad4cc60d954e1c6642cc3c64d16 /app/models
parentfede678430be34f854bcf7e39c29d5e5ecea929b (diff)
Figured out mailboxer for sending pms and updated individual message view.
Diffstat (limited to 'app/models')
-rw-r--r--app/models/pm.rb14
-rw-r--r--app/models/user.rb8
2 files changed, 20 insertions, 2 deletions
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 }