Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

just panda #24

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 0 additions & 50 deletions README.md

This file was deleted.

6 changes: 0 additions & 6 deletions config/database.yml.sample

This file was deleted.

13 changes: 0 additions & 13 deletions db/migrate/201205031300_create_networks.rb

This file was deleted.

17 changes: 15 additions & 2 deletions db/seed.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
# Cleaning Out

Network.delete_all
Show.delete_all
Coffee.delete_all

amc = Network.create(name: "AMC")
nbc = Network.create(name: "NBC")
netflix = Network.create(name: "Netflix")
Show.create(name: "Mad Men", day_of_week: "Sunday", hour_of_day: 22, network: amc)
Show.create(name: "Community", day_of_week: "Thursday", hour_of_day: 20, network: nbc)
Show.create(name: "Community", day_of_week: "Thursday", hour_of_day: 19, network: nbc)
Show.create(name: "House of Cards", day_of_week: "Thursday", hour_of_day: 0, network: netflix)
Show.create(name: "Orange is the New Black", day_of_week: "Sunday" , hour_of_day: 0, network: netflix)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 on the shows, BTW. I ❤️ them 😃

Coffee.create(name: 'Costa Rica', grade: 'SHB EP', process: 'Washed', region: 'Santa Maria de Dota', roast: 'Full City')
Coffee.create(name: 'Guatemala', grade: 'SHB', process: 'Washed', region: 'San Pedro Necta', roast: 'City')
Coffee.create(name: 'Honduras', grade: 'SHB', process: 'Washed', region: 'Ocotopeque', roast: 'City - Full City')
Coffee.create(name: 'Bolivia', grade: 'n/a', process: 'n/a', region: 'Caranavi', roast: 'Just brew')
Coffee.create(name: 'Java', grade: 'One', process: 'Washed', region: 'Java Sunda', roast: 'Full City')


5 changes: 3 additions & 2 deletions models/show.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
class Show < ActiveRecord::Base
belongs_to :network

validates_presence_of :name
validates_presence_of :name

def to_s
"#{name} airs at #{hour_of_day}:#{day_of_week}:00 on #{network} "
end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is that formatting local to your culture? 05:Wed:00 on NBC?

Or, did "day_of_week" sneek in there instead of minute?

end


Empty file removed spec/.gitkeep
Empty file.
35 changes: 33 additions & 2 deletions watchman.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,38 @@

Network.all.each do |network|
puts "Shows airing on #{network}"
network.shows.each do |show|
network.shows.each do |show| #this is really cool
puts show
end
end
end
puts "------------------------"

puts "Which day do you want to watch the show?"
day = gets.chomp().capitalize
puts "Shows airing on #{day}"


#Show.all.each do |show|
# puts show if show.day_of_week == day
#end

Show.all.to_a.select{|show| show.day_of_week == day}.each do |show|
puts show
end

puts "-------------------------"

Coffee.all.each do |coffee|
puts coffee.name
end

puts "Which coffee do you want to know more about?"
cof = gets.chomp().capitalize
#Coffee.all.each do |coffee|
# puts coffee if coffee.name == cof
#end

Coffee.all.to_a.select{|coffee| coffee == cof}.each do |coffee|
puts coffee

end