app/models/activity.rb
def activity_stats
    average_rating = Activity.where(possibility_id: self.possibility_id, user_id: self.user_id).average("rating")
    if average_rating!= nil
      puts "Your average rating for this activity, on a scale of 1-5, is: " + Rainbow("#{average_rating.round(2)}").bright
    end
  end
#---calculates and displays average rating of possiblity by user
calculates and displays average rating of possiblity by user
calculates and displays average rating of possiblity by user
def activity_stats
    average_rating = Activity.where(possibility_id: self.possibility_id, user_id: self.user_id).average("rating")
    if average_rating!= nil
      puts "Your average rating for this activity, on a scale of 1-5, is: " + Rainbow("#{average_rating.round(2)}").bright
    end
  end
def activity_stats average_rating = Activity . where ( possibility_id : self . possibility_id , user_id : self . user_id ) . average ( "rating" ) if average_rating != nil puts "Your average rating for this activity, on a scale of 1-5, is: " + Rainbow ( "#{average_rating.round(2)}" ) . bright end end
calculates and displays average rating of possiblity by user
calculates and displays average rating of possiblity by user