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

13 -- ActiveRecord -- Angela Bier #114

Open
19 of 43 tasks
angelabier1 opened this issue Jan 27, 2015 · 2 comments
Open
19 of 43 tasks

13 -- ActiveRecord -- Angela Bier #114

angelabier1 opened this issue Jan 27, 2015 · 2 comments

Comments

@angelabier1
Copy link

Tasks

  • A WIP Issue in the class repo _(S)_
    • Titled appropriately
    • With check boxes for the tasks and any subtasks you can identify
    • Estimates for the top-level checkboxes
  • Update your TIY-Assignments wiki _(S)_
    • Assignment Evaluation
    • Lightbulbs
    • Things I Don’t Get Yet
  • Create a branch in your TIY-Assignments repo, named appropriately _(S)_
  • A Pull Request in your TIY-Assignments folder as on previous assignments _(S)_
  • Comments on your WIP Issue as on previous assignments _(S)_
    • Link to Wiki
    • Link to Pull Request (in Markdown)
  • The queries you need to write in the Rails console to work out the following selects (saved as activenfl_queries.rb): _(L)_
    • Select every team from the NFC North
    • Select every team with at least 11 wins
    • Select every team with at least 8 wins that did not make the playoffs
    • Rename every team with fewer than 4 wins "Losers"
    • Select every team that plays in a city of fewer than 5 million people, and the name of the city
    • Select every AFC team that plays in a city that is shrinking in population
    • Select every city that has a team
    • Select every state that has a team
    • Select every team that plays in California
    • Find the 3 smallest cities with NFL teams
    • Find the number of teams in cities of between 1 million and 2 million (as of 2013)
    • Find the division with the largest average number of wins
    • List the names of the teams of the AFC in descending order of the size of their cities
    • Change the name of the 5th largest city in New Jersey to include the phrase "like the inventor"
    • Remove New Mexico and all its cities from the database with one line in the console. You can edit a line in file in app/models too.
  • Try to get the effect of each of these in the console, and once you have something that works, write a method in the appropriate place. _(L)_
    • city.rb file with the following methods:
      • Define a method City.fastest_growing that returns the single fastest growing city
      • Define a method City.shrinking that returns all cities with decreasing population
    • team.rb file with the following methods:
      • Define a method Team#division_rivals that returns all other teams in the same (conference and) division
      • Define a method Team#division_leader? that checks whether a team has more wins than any other team in its (conference and) division
      • Define a method Team#division_winner? that checks whether a team leads its division and all its division rivals have played 16 games.
  • Read the following Rails Guides: _(M)_
    • Active Record Basics
    • Active Record Associations, Section 1-2.3
    • Active Record Querying
    • Active Record Validations
    • Active Record Migrations
@angelabier1
Copy link
Author

Pull Request

@angelabier1
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant