-
Notifications
You must be signed in to change notification settings - Fork 21
Panda, Tiger & Eagle level complete #7
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
ralphos
wants to merge
6
commits into
RubyoffRails:master
Choose a base branch
from
ralphos: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 all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
611e034
Panda Level: Preview added to Page and edited content to make winner/…
ralphos fd1afc1
Tiger level: extracted Page.creates into seed file and loaded it
ralphos 6fee50d
Tiger level: user now has to make two selections to determine conclusion
ralphos 1b60a0a
Eagle level: Page does not have a parent anymore and instead stores i…
ralphos 567ed3e
Refactored options method to simply return array of ids.. duh
ralphos 550a55a
Eagle level: Either path now shares option_d on the 3rd tier
ralphos 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 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,7 @@ | ||
| source 'http://rubygems.org' | ||
|
|
||
| gem 'rake' | ||
| gem 'rspec' | ||
| gem 'rspec', '~> 2.11.0' | ||
| gem 'activesupport' | ||
| gem 'activerecord' | ||
| gem 'pg' |
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
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
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,10 +1,13 @@ | ||
| class CreatesPage < ActiveRecord::Migration | ||
| def change | ||
| create_table :pages do |t| | ||
| t.text :preview | ||
| t.text :content | ||
| t.integer :parent_id | ||
| t.boolean :starting_point, default: false | ||
| t.boolean :conclusion, default: false | ||
| t.boolean :winner, default: false | ||
| t.integer :option_a_id | ||
| t.integer :option_b_id | ||
| end | ||
| end | ||
| end |
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 +1,40 @@ | ||
| # Cleaning Out | ||
| Page.delete_all | ||
|
|
||
| # Child pages | ||
| option_c = Page.create(conclusion: true, | ||
| content: "You're seeing things. A bear appears and eats you. YOU DEAD!", | ||
| preview: "Walk towards the light... your destiny awaits!") | ||
|
|
||
| option_d = Page.create(conclusion: true, | ||
| content: "It is! You stumble across Bacon Land where bacon is free and everywhere! WIN!", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yay free bacon! |
||
| preview: "You smell more bacon... could it be true!?", | ||
| winner: true) | ||
|
|
||
| option_e = Page.create(conclusion: true, | ||
| content: "No it isn't! FAIL. YOU LOSE!", | ||
| preview: "You're bacon sandwich it isn't sitting well. Is that a toilet nearby?") | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Free bacon: not the best idea, honestly |
||
|
|
||
| option_f = Page.create(conclusion: true, | ||
| content: "Well what do ya' know?? YOU WIN!", | ||
| preview: "A sign appears saying, 'Go this way and you will win big'..", | ||
| winner: true) | ||
|
|
||
| option_a = Page.create(conclusion: false, | ||
| content: "You're rich! Or not... You must continue on your journey to cash your gold pieces in...", | ||
| preview: "A long journey awaits, but it could be worth it...", | ||
| option_a_id: option_c.id, | ||
| option_b_id: option_d.id) | ||
|
|
||
| option_b = Page.create(conclusion: false, | ||
| content: "You ate the bacon sandwich! Now you're even hungrier! Onwards march...", | ||
| preview: "Tired and hungry, this could be just what you need!", | ||
| option_a_id: option_e.id, | ||
| option_b_id: option_d.id) | ||
|
|
||
| # Current page / starting point | ||
| page = Page.create(starting_point: true, | ||
| content: "You wake up on a road. It's foggy and dampy. In your bag is 30 gold pieces and a bacon sandwich. Which do you choose?", | ||
| preview: "30 gold pieces would make you rich... But that bacon sandwich smells awfully good!", | ||
| option_a_id: option_a.id, | ||
| option_b_id: option_b.id) | ||
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
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 |
|---|---|---|
|
|
@@ -5,7 +5,6 @@ def self.starting_point | |
| end | ||
|
|
||
| def options | ||
| Page.where(:parent_id => id).limit(2) | ||
| [option_a_id, option_b_id] | ||
| end | ||
|
|
||
| end | ||
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
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
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.
another student did this and I liked it when you wanted empty lines: