class Profile

Constants

ROLES

Public Class Methods

list() click to toggle source

manager uses it. @TODO: check this, this is shit. vp 20170527

# File lib/ish_models/user_profile.rb, line 54
def self.list
  out = self.all.order_by( :domain => :asc, :lang => :asc )
  [['', nil]] + out.map { |item| [ item.name, item.id ] }
end

Public Instance Methods

current_order() click to toggle source
# File lib/ish_models/user_profile.rb, line 65
def current_order
  self.orders.where( :submitted_at => nil ).first || CoTailors::Order.create( :profile => self )
end
has_premium_purchase(item) click to toggle source
# File lib/ish_models/user_profile.rb, line 74
def has_premium_purchase item
  item.premium_purchases.where( user_profile: self ).exists?
end
sudoer?() click to toggle source
# File lib/ish_models/user_profile.rb, line 48
def sudoer?
  %w( piousbox@gmail.com victor@wasya.co ).include?( self.user.email ) ? true : false
end