Skip to content

Fix inverts search, when have additional conditions in scope (like de… #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

le0pard
Copy link
Owner

@le0pard le0pard commented Oct 3, 2024

…fault_scope)

gregmolnar and others added 17 commits February 6, 2025 20:49
…#1545)

* Rails 7.2.2.1 doesn't need 7.2 join association

* drop Rails 6 support

* drop Rails 7.0 support

* update changelog
Updating docs for required allowlists in v4.0
… conditions (activerecord-hackery#1543)

* Raise Ransack::InvalidSearchError instead of ArgumentError on unknown conditions

* Update CHANGELOG
)

* Update activerecord and activesupport version

* Change activerecord and activesupport version to >=7.1
Co-authored-by: Greg Molnar <gregmolnar@users.noreply.github.com>
* Wrap Polyamorous module in on_load(:active_record)

* Remove defined? ActiveRecord check from form builder

* Require ActiveSupport.on_load explicitly

* Load ransack first in specs to expose load order issues

* Requiring more pieces of ActiveSupport

I am not sure whether going down this path is the best approach. I feel
that perhaps ActiveSupport could require everything within
active_support/core_ext to ensure that active_support/core_ext can load
itself. Still, there's no changing old versions of Rails, so I suppose
this solution works? I am also not sure what the Rails team would
recommend when it comes to requiring specific pieces of ActiveSupport
(to leverage things like mattr_accessor).

In any case, I was able to reproduce the CI failures locally and these
changes make everything pass for me locally.

---------

Co-authored-by: Sean <sean@immersive-app.com>
Co-authored-by: Greg Molnar <gregmolnar@users.noreply.github.com>
Co-authored-by: Matheus Oliveira <matheussilvasantos@proton.me>
The casting of condition values is incorrect for enums. The value is a
number but enum type under the hood (DB) is an integer, so the string
values get casted to zero.

Apparently this casting is not actually needed (except for converting
dates) because ActiveRecord handles this just fine internally. So I
removed it and it seems to fix enums and does not make any specs fail.

Co-authored-by: Peko <91131029+pekopekopekopayo@users.noreply.github.com>
)

Ensure malformed or malicious user input doesn't crash the Rails page.

Previously, when a user submits a non-empty array, it would raise the
exception:

```
NoMethodError: undefined method 'to_i' for an instance of Array
```

Fixes activerecord-hackery#1556
Co-authored-by: Sean <sean@immersive-app.com>
Co-authored-by: Sean <sean@immersive-app.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.