Coder Social home page Coder Social logo

active-record-association-methods's People

Contributors

ahimmelstoss avatar annjohn avatar aturkewi avatar aviflombaum avatar babyshoes avatar benjagross avatar curiositypaths avatar deniznida avatar dependabot[bot] avatar fislabstest avatar fs-lms-test-bot avatar genericlady avatar jmburges avatar joshuabamboo avatar kthffmn avatar loganhasson avatar maxwellbenton avatar msuzoagu avatar octosteve avatar pletcher avatar roseweixel avatar rrcobb avatar sarogers avatar sophiedebenedetto avatar victhevenot avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

active-record-association-methods's Issues

id should be 1 and not nil

After rake console, the id returned should be 1 and not nil

I got a return of id:1 in my terminal by following precisely. I asked AAQ Tech Coach why because I'm trying to understand.


Association Methods
Go ahead and run the test suite and you'll see that we are passing the first 14 tests. Our associations are all working, just because of our migrations and use of macros.

We can now call methods on the objects we associated with one another. Let's play around with our code using the console task we wrote for you in the Rakefile.

rake console
hello = Song.create(name: "Hello")
=> #<Song:0x007fc75a8de3d8 id: nil, name: "Hello", art

Move to `sinatra-activerecord` and `database_cleaner`

Our migrate_db method and db:migrate tasks are error prone.

We should just use the rake tasks provided by sinatra-activerecord and deprecate rolling our own migration tasks. We'd also have to use database_cleaner in the tests. While we're at it, throw require_all that way all labs are adopting these three gems as patterns.

Gem issues in Nitrous

Not sure if this is related to Nitrous or what, but having issues with the gems.
Just re-forked/cloned the lab, ran bundle install (installing 22 gems), then rake db:migrate, and got

➜ Active-Record-Association-Methods-v-000 git:(master) ✗ rake db:migrate
Could not find pry-0.10.1 in any of the sources
Run bundle install to install missing gems.

Ran bundle update, then rake db:migrate again:
➜ Active-Record-Association-Methods-v-000 git:(master) ✗ rake db:migrate
Could not find activemodel-4.2.6 in any of the sources
Run bundle install to install missing gems.

Tried this again, and it's still stuck on activemodel-4.2.6.

Tried deleting the gemfile.lock and rerunning, but same errors.

I've been trying to do this lab since January, and back then I ran into issues with the migrations not loading in the correct order. It's the same issue seen here: #5

I took a break and came back to this lab. This gem problem I'm describing didn't start until about a month ago or so.

Test for "drake_made_this"

Hi, you may want to consider re-writing the test for "drake_made_this" which is the last test for this lab. The instructions never explicitly says to return an artist from the method, but the test requires that an artist with the name of "Drake" is returned. Furthermore, that return value of the method is the only thing being tested, so you can actually pass the test without properly setting the song's artist as long as the method returns an Artist whose name is Drake. I passed the tests using just one line in the last method: Artist.find_or_create_by(name: "Drake"), which clearly doesn't change the song's artist. Thanks!

learn-co gem not in gemfile for lab

when running 'learn', was prompted to add "learn-co" gem to gem file.
// ♥ learn
/Users/BradSmith/.rvm/gems/ruby-2.2.3/gems/bundler-1.11.2/lib/bundler/rubygems_integration.rb:304:in block in replace_gem': learn-co is not part of the bundle. Add it to Gemfile. (Gem::LoadError) from /Users/BradSmith/.rvm/gems/ruby-2.2.3/bin/learn:22:in

'
from /Users/BradSmith/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in eval' from /Users/BradSmith/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in'
bash: parse_git_branch: command not found

After adding it, was able to run 'learn', but still got the following message:

// ♥ learn submit
Adding changes...
Committing changes...
Pushing changes to GitHub...
Submitting lesson...
Done.
bash: parse_git_branch: command not found
[21:32:45] Active-Record-Association-Methods-v-000

Clarity on last test (drake_made_this)

Can it be made explicit that Drake does not exist in the db for this test? Also more clarity on return values would be great, as according to the wording of the test
self.artist = Artist.find_by(name: "Drake")
should work, but I could only get self.artist = Artist.find_or_create_by(name: "Drake") to pass the test.

Thanks!

Migration issues

Just started with "bundle install" and when I run rake db:migrate, getting this:

➜ Active-Record-Association-Methods-v-000 git:(master) ✗ rake db:migrate
== CreateGenres: migrating ===================================================
-- create_table(:genres)
-> 0.0076s
== CreateGenres: migrated (0.0078s) ==========================================
== AddGenreToSongs: migrating ================================================
-- add_column(:songs, :genre_id, :integer)
rake aborted!
SQLite3::SQLException: no such table: songs: ALTER TABLE "songs" ADD "genre_id" integer

json 1.8.3 error

when I run rake db:migrate I'm getting an error that json 1.8.3 is not installed
so I tried to manually "bundle install" as well as a direct "gem install json -v '1.8.3'"
with no success. in the end I had to run "bundle update" to resolve the situation, so it seems that the preexisting "gemfile.lock" file needs a update.

THANKS

rake db:migrate does not work

The lab says that we should be able to run rake db:migrate the first thing in the lab, but when I run it, none of the tests pass and it throws a lot of errors. Can you please fix this?

Pull request -> lab marked as completed, even if some tests still failing

In the middle of working through rspeclementing this lab, I took a moment to create a new branch, committed a suggested improvement to it, and created a pull request for it. After doing this and refreshing the lab page on Learn, the Learn web app marked the lab as completed - even though some of my tests are still failing.

The web app should not mark a lab as completed if the code in the latest pull request submitted by the user isn't passing all the tests, or if not that, then at least it shouldn't mark a lab as completed until student has done at least one run of learn where all tests pass at the same time.

having trouble migrating my databse on this lab

Active-Record-Association-Methods-v-000 git:(master) ✗ rake db:migrate
== CreateGenres: migrating ===================================================
-- create_table(:genres)
-> 0.0070s
== CreateGenres: migrated (0.0072s) ==========================================
== AddGenreToSongs: migrating ================================================
-- add_column(:songs, :genre_id, :integer)
rake aborted!

Songs spec file needs to create Artist 'Drake'

The last test fails because no Artist instance is created in the specfile. This can be corrected by adding

@drake = Artist.create(name: "Drake")

inside of the before statement in 09_song_methods_spec.rb

Error loading lab with learn IDE

when opening the ide for this lab, it returns an error
learn open Active-Record-Association-Methods-online-web-ft-090919 Looking for lesson... Hmm...Cannot find lesson with repo: active-record-association-methods-online-web-ft-090919. Please check your input and try again.
I am able to clone the lab directly, but then am unable to cd into the lessons directory to run learn. All other labs open as expected.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.