class User < ActiveRecord::Base has_many :events has_many :ratings has_many :messages belongs_to :profile def self.create_with_omniauth(auth) create! do |user| user.provider = auth["provider"] user.uid = auth["uid"] user.firstname = (auth["info"]["name"]).split.first user.lastname = (auth["info"]["name"]).split.last end end # This method generates a list of random list of users based on the size of the pool def self.search x = User.all.size b = [] users = User.all.shuffle x.times do |y| b << users[rand(y)] end b.uniq! return b end end