-
Notifications
You must be signed in to change notification settings - Fork 27
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
Watchman assignment submission #30
Open
codeblahblah
wants to merge
7
commits into
RubyoffRails:master
Choose a base branch
from
codeblahblah: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
7 commits
Select commit
Hold shift + click to select a range
bde51b4
Watchman assignment submission.
codeblahblah d29f4a2
Added Eagle level features.
codeblahblah 5621cf9
Added corrections to all levels.
codeblahblah 779c2b6
Added final features to assignment.
codeblahblah e98ecd6
Moved Beer.delete_all closer to clean-out section of seed.rb.
codeblahblah eb09bf6
Switched to ActiveRecord method call.
codeblahblah 2467ef1
Switched to Show#where instead of Show#find_by...
codeblahblah 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 contains 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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class CreateBeers < ActiveRecord::Migration | ||
|
||
def change | ||
create_table :beers do |t| | ||
t.string :name | ||
t.string :country | ||
t.string :brewer | ||
t.string :kind_of | ||
t.integer :rating | ||
t.string :summary | ||
t.timestamps | ||
end | ||
end | ||
end |
This file contains 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,27 @@ | ||
# Cleaning Out | ||
Network.delete_all | ||
Show.delete_all | ||
Beer.delete_all | ||
|
||
amc = Network.create(name: "AMC") | ||
nbc = Network.create(name: "NBC") | ||
cine = Network.create(name: "Cinemax") | ||
usa = Network.create(name: "USA Network") | ||
netflix = Network.create(name: "Netflix") | ||
sho = Network.create(name: "Showtime") | ||
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: "Breaking Bad", day_of_week: "Sunday", hour_of_day: 22, network: amc) | ||
Show.create(name: "Banshee", day_of_week: "Friday", hour_of_day: 22, network: cine) | ||
Show.create(name: "Suits", day_of_week: "Thursday", hour_of_day: 21, network: usa) | ||
Show.create(name: "House of Cards", day_of_week: "Friday", hour_of_day: 20, network: netflix) | ||
Show.create(name: "House of Lies", day_of_week: "Sunday", hour_of_day: 22, network: sho) | ||
|
||
Beer.create(name: 'Nova Schin', country: 'Brazil', brewer: ' Brasil Kirin', kind_of: 'Pilsner', rating: 5, summary:'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed') | ||
Beer.create(name: 'Tusker', country: 'Kenya', brewer: 'East African Breweries', kind_of: 'Lager', rating: 4, summary: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ...') | ||
Beer.create(name: 'Tui', country: 'New Zealand', brewer: 'DB Breweries', kind_of: 'Indian Pale Ale', rating: 4, summary: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ...') | ||
Beer.create(name: 'Victoria Bitter', country: 'Australian', brewer: 'Carlton & United Breweries, Ltd', kind_of: 'Lager', rating: 1, summary: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ...') | ||
Beer.create(name: 'Tiger', country: 'Singapore', brewer: 'Foo', kind_of: 'Lager', rating: 3, summary: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tsummary: incidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ...') | ||
Beer.create(name: 'Sapporo', country: 'Japan', brewer: 'Sapporo Breweries Ltd', kind_of: 'Lager', rating: 2, summary: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ...') | ||
Beer.create(name: 'Castle', country: 'South Africa', brewer: 'South African Breweries Ltd', kind_of: 'Lager', rating: 5, summary: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ...') | ||
Beer.create(name: 'Windhoek', country: 'Namibia', brewer: 'Namibia Breweries', kind_of: 'Lager', rating: 2, summary: 'Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ...') |
This file contains 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class Beer < ActiveRecord::Base | ||
|
||
def to_s | ||
"\"#{name}\" , [#{kind_of}, #{country}, #{brewer}]" | ||
end | ||
|
||
def summarize | ||
"#{name} is a #{kind_of} from #{country}.\n#{summary}.\nI rate it a #{rating} out of 5." | ||
end | ||
end |
This file contains 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
This file contains 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
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.
AWESOME