-
Notifications
You must be signed in to change notification settings - Fork 27
Panda Tiger Eagle - Done #25
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
Open
var114
wants to merge
6
commits into
RubyoffRails:master
Choose a base branch
from
var114:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) | ||
|
|
||
| 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') | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| end | ||
|
|
||
|
|
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Side note --- calling
gets.chomp()is fine... but the () it optional. You could just callor, if it suits you:
It doesn't matter much -- though I recommend you pick a style and go with it for a codebase. Having devs each write differently makes code hard to understand at a glance.