palkan / n_plus_one_control

RSpec and Minitest matchers to prevent N+1 queries problem
MIT License
555 stars 20 forks source link

Add `perform_linear_number_of_queries` rspec matcher #39

Closed caalberts closed 3 years ago

caalberts commented 4 years ago

perform_linear_number_of_queries takes a parameter slope to allow for linear number of queries.

What changes did you make? (overview)

Add a rspec matcher .perform_linear_number_of_queries(slope: 1) to allow for linear number of queries..

Is there anything you'd like reviewers to focus on?

Checklist

caalberts commented 4 years ago

@palkan Could you have another look please?

caalberts commented 4 years ago

@palkan I have made the additional changes. Could you take a look again please?

caalberts commented 4 years ago

@palkan Rebased.

Would you like to add Minitest support as well? Just asking, we can add it later.

I'm not very familiar with Minitest. So maybe we can separate it into another PR?

caalberts commented 4 years ago

@palkan Rebased.

Would you like to add Minitest support as well? Just asking, we can add it later.

I'm not very familiar with Minitest. So maybe we can separate it into another PR?

I started a draft in https://github.com/caalberts/n_plus_one_control/pull/1. I'll move it into this repository after this PR is merged.