generica/app/models/admin/user.rb in cloudrider-0.3.22 vs generica/app/models/admin/user.rb in cloudrider-0.3.23
- old
+ new
@@ -52,9 +52,17 @@
has_many :offers,
-> { order "#{Apiv1::OfferMessage.table_name}.created_at desc" },
through: :products,
class_name: 'Apiv1::OfferMessage'
+ def default_email
+ primary_contact.try(:email) || email
+ end
+
+ def all_known_emails
+ contacts.map(&:email).push(email).select(&:present?)
+ end
+
def to_ember_hash
{
id: id,
email: email,
user_rank: user_rank,