The ActiveRecord module in Rails is one of the core components which have contributed to the success and popularity of the framework. True proficiency in Rails requires a sound understanding of the API offered by this ActiveRecord module. Take a look at the quiz below to see how well you know the Rails ActiveRecord API.

Introduction

In our previous post we discussed how the Rails ActiveRecord implementation offers a extensive API for you data-modelling requirements.

In this post we allow you to test your mastery of this API with a short 10-question quiz. Give it a go and see how well you know the Rails ActiveRecord API!

References

  1. Official Rails ActiveRecord::Base docs
  2. Active record pattern as formalized in PoEAA

Comments

  • Submitted by Your Conscience
    over 1 year ago

    Why do you require an email? That's fishy! Why don't you ask for credit card info too? Try to become better people in the future. And don't you Google's captcha service, they track way too much.

    • Submitted by Domhnall Murphy
      over 1 year ago

      Hi, thanks for giving this a try. If you wish to receive a report on the questions that you got correct/incorrect tnen you will need to enter your email address. However, if you just want to see your score you can enter a dummy email address as suggested.

  • Submitted by Nikita
    over 1 year ago

    I get incorrect answer in question 3 when choose User.where(id: [2,4]).each(&:destroy)

    • Submitted by Domhnall Murphy
      over 1 year ago

      Hi thanks for trying this out. You need to select ALL the valid answers in order to get the question correct.

  • Submitted by Foo Bar
    over 1 year ago

    Nice quiz, but IMO there's no reason to ask for an email. For future quiz takers: https://10minutemail.com/

    • Submitted by Domhnall Murphy
      over 1 year ago

      Thanks for your feedback. I understand the reluctance, from some people, to share their email in this context. Even without an email you should be able to complete the quiz and see your result ... so hopefully the quiz is still useful when used in this way. If you are willing to share your email, you will get an email with a link to access the solution, including the questions which you got correct/incorrect. We will also keep you updated when similar content is published. I felt like this was a reasonable quid pro quo, but will definitely be keeping an eye on how this is received by readers. Thanks.

  • Submitted by Michael
    over 1 year ago

    Can we get the solutions, please?

    • Submitted by Domhnall Murphy
      over 1 year ago

      Hi Michael, thanks for giving it a go. If you enter your email in the form at the end of the quiz you should be emailed a link that will include the solutions, and allow you to review the questions which you got correct/incorrect.

  • Submitted by valerius
    over 1 year ago

    Why is the quiz timed? and so little at that? I'm new to rails and im using this as a means to deepen my understanding of AR's functionality and having a short timer denying me the time to think through what each operation is is really annoying.

    • Submitted by Domhnall Murphy
      over 1 year ago

      Hi, thanks for the feedback. I believe it is necessary to set a reasonable time limit on the question to reduce the possibility of copy and pasting code into the Rails console to get the answer, which I believe defeats the purpose of the quiz. A few people have made a similar point about having insufficient time for each of the questions. For the sake of consistency, I feel that I should leave the current question timings in their present state. But I will definitely take this feedback on board for future quizzes, and allow a bit more time for each response. Thanks.

Got your own view or feedback? Share it with us below …

×

Subscribe

Join our mailing list to hear when new content is published to the VectorLogic blog.
We promise not to spam you, and you can unsubscribe at any time.