Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
`FlexSearch.some_query :page => 1, :size => 10` used to raise "TypeError: nil can't be coerced into Fixnum". That's because the `:from` computation used to be of the form `(page - 1) * vars[:params][:size] || vars[:size] || 10`, which gets operator precedence wrong: it's parsed the same as `((page - 1) * vars[:params][:size]) || vars[:size] || 10`. So, if `vars[:page]` is specified but `vars[:params][:size]` isn't, we multiply a number by a nil, which raises an error. We *could* just apply better grouping, but a new variable declaration is more readable, anyway.
- Loading branch information