In my Rails app, I use Rubocop
to check for problems. Today it gave me an error like this : Assignment Branch Condition size for show is too high
. Here's my code :
def show
@category = Category.friendly.find(params[:id])
@categories = Category.all
@search = @category.products.approved.order(updated_at: :desc).ransack(params[:q])
@products = @search.result.page(params[:page]).per(50)
rate
end
What does this mean and how can I fix it?
rubocop
's formal way of saying "your method does too much". – Ooze