app/models/cli.rb
#-----creates a new activity entry from the suggested possiblity if rejected or accepted with special case of Create New Possiblity
creates a new activity entry from the suggested possiblity if rejected or accepted with special case of Create New Possiblity
creates a new activity entry from the suggested possiblity if rejected or accepted with special case of Create New Possiblity
def create_activity
    if self.accepted_or_rejected == "1"
      if self.possibility.name == "Create a New Possibility for the Future"
        puts ""
        puts Rainbow("*").blue * 70
        puts ""
        puts ""
        puts ""
        puts ""
        puts ""
        puts "Okay, let's begin!"
        puts ""
        puts "What should we call your new possibility? A short, decriptive name will do the trick."
        puts ""
        self.new_possibility_name = gets.strip
        self.quit if self.new_possibility_name == "quit"
        puts ""
        puts Rainbow("*").blue * 70
        puts ""
        puts ""
        puts ""
        puts ""
        puts ""
        puts "Write a brief description (about a sentence or two) of your new possibility."
        puts ""
        self.new_possibility_description = gets.strip
        self.quit if self.new_possibility_description == "quit"
        puts ""
        puts Rainbow("*").blue * 70
        puts ""
        puts ""
        puts ""
        puts ""
        puts ""
        puts "About how long should it take to complete this possibility?"
        puts ""
        puts ""
        puts " 1. Less than 15 minutes."
        puts " 2. 15 minutes - 30 minutes."
        puts " 3. More than 30 minutes."
        puts ""
        puts ""
        puts "Please enter a number."
        self.new_possibility_duration = gets.strip
        self.quit if self.new_possibility_duration == "quit"
        puts ""
        puts Rainbow("*").blue * 70
        puts ""
        puts ""
        puts ""
        puts ""
        puts ""
        puts "Is this possibility something I can do at home, at work, anywhere but work, or anywhere at all?"
        puts ""
        puts " 1. I can only do this at home"
        puts " 2. I can only do this at work"
        puts " 3. I can do this anywhere but work"
        puts " 4. I can do this anywhere at all"
        puts ""
        puts ""
        puts "Please enter a number."
        self.new_possibility_required_location = gets.strip
        self.quit if self.new_possibility_required_location == "quit"
        create_new_possibility
      else
      self.activity = Activity.create(status: "accepted", user_id: self.user.id, possibility_id: self.possibility.id)
      puts ""
      puts ""
      self.complete_activity
      end
    elsif self.accepted_or_rejected == "2"
      self.activity = Activity.create(status: "rejected", user_id: self.user.id, possibility_id: self.possibility.id)
      puts ""
      puts ""
      puts "Suggesting another possibility..."
      puts ""
      puts ""
      self.suggest_possibility
    elsif self.accepted_or_rejected == "3"
      self.activity = Activity.create(status: "rejected", user_id: self.user.id, possibility_id: self.possibility.id, exclude: true)
      puts ""
      puts Rainbow("*").blue * 70
      puts ""
      puts ""
      puts ""
      puts ""
      puts ""
      puts "Got it! I won't show that possiblity again."
      self.suggest_possibility
    end
  end
def create_activity if self . accepted_or_rejected == "1" if self . possibility . name == "Create a New Possibility for the Future" puts "" puts Rainbow ( "*" ) . blue * 70 puts "" puts "" puts "" puts "" puts "" puts "Okay, let's begin!" puts "" puts "What should we call your new possibility? A short, decriptive name will do the trick." puts "" self . new_possibility_name = gets . strip self . quit if self . new_possibility_name == "quit" puts "" puts Rainbow ( "*" ) . blue * 70 puts "" puts "" puts "" puts "" puts "" puts "Write a brief description (about a sentence or two) of your new possibility." puts "" self . new_possibility_description = gets . strip self . quit if self . new_possibility_description == "quit" puts "" puts Rainbow ( "*" ) . blue * 70 puts "" puts "" puts "" puts "" puts "" puts "About how long should it take to complete this possibility?" puts "" puts "" puts " 1. Less than 15 minutes." puts " 2. 15 minutes - 30 minutes." puts " 3. More than 30 minutes." puts "" puts "" puts "Please enter a number." self . new_possibility_duration = gets . strip self . quit if self . new_possibility_duration == "quit" puts "" puts Rainbow ( "*" ) . blue * 70 puts "" puts "" puts "" puts "" puts "" puts "Is this possibility something I can do at home, at work, anywhere but work, or anywhere at all?" puts "" puts " 1. I can only do this at home" puts " 2. I can only do this at work" puts " 3. I can do this anywhere but work" puts " 4. I can do this anywhere at all" puts "" puts "" puts "Please enter a number." self . new_possibility_required_location = gets . strip self . quit if self . new_possibility_required_location == "quit" create_new_possibility else self . activity = Activity . create ( status : "accepted" , user_id : self . user . id , possibility_id : self . possibility . id ) puts "" puts "" self . complete_activity end elsif self . accepted_or_rejected == "2" self . activity = Activity . create ( status : "rejected" , user_id : self . user . id , possibility_id : self . possibility . id ) puts "" puts "" puts "Suggesting another possibility..." puts "" puts "" self . suggest_possibility elsif self . accepted_or_rejected == "3" self . activity = Activity . create ( status : "rejected" , user_id : self . user . id , possibility_id : self . possibility . id , exclude : true ) puts "" puts Rainbow ( "*" ) . blue * 70 puts "" puts "" puts "" puts "" puts "" puts "Got it! I won't show that possiblity again." self . suggest_possibility end end
creates a new activity entry from the suggested possiblity if rejected or accepted with special case of Create New Possiblity
creates a new activity entry from the suggested possiblity if rejected or accepted with special case of Create New Possiblity
#-----------move this section to possiblity creation method under possiblity see note: 1 in todo #--------------------------- #-------reject activity #--rejects and exclude