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
- Official Rails
ActiveRecord::Base
docs - Active record pattern as formalized in PoEAA
Comments
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.
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.
I get incorrect answer in question 3 when choose User.where(id: [2,4]).each(&:destroy)
Hi thanks for trying this out. You need to select ALL the valid answers in order to get the question correct.
Nice quiz, but IMO there's no reason to ask for an email. For future quiz takers: https://10minutemail.com/
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.
Can we get the solutions, please?
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.
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.
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 …