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
    about 1 month 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
      about 1 month 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
    about 1 month ago

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

    • Submitted by Domhnall Murphy
      about 1 month 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
    about 1 month 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
      about 1 month 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
    about 1 month ago

    Can we get the solutions, please?

    • Submitted by Domhnall Murphy
      about 1 month 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.

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