Comments (2)
Wait.... so you have a DB string, and you're storing an "array" of numbers, in a string that looks like: "[1,2,3,5,20]", right?
So, that comparison operation will have to be done at the database level... If you're using MySQL, you might want to store the data in a set, which is essentially the same thing minus the [], then use FIND_IN_SET. If you're using another database, you will need to do some munging to the attribute to compare with the input value. You could probably set up a ransacker on the model in question to generate the SQL you need.
from ransack.
i'm work with postgresql.
So i found if i add "" ("2" in my previous example) in the search form, the result is good.
the "" is use for exactly matches or is just an artefact with my DB.
then, how to make all search "exactly" by default ?
from ransack.
Related Issues (20)
- Sorting non-english characters HOT 4
- Range of Dates Query converting to UTC before query
- SQL aliases are not supported when joining relations - at least with PG HOT 1
- not_eq doesn't seems to work with a relation
- Undefined method with predicates HOT 1
- Ransack _in using Dio HOT 1
- NoMethodError: undefined method `table_name' with Rails 7.1.0 HOT 3
- NameError: undefined method `binary' for class `Arel::Visitors::DepthFirst'
- Polymorphic Search not working on nested association HOT 1
- Raising ArgumentError exception on Ransack operations HOT 3
- `_cont` filter adding extra quotes HOT 1
- Security change to ransackable attribute leads to potentially huge overhead when using postgresql HOT 3
- Bug report templates use Minitest
- Using Trigram pg extension for more performant text similarity searches HOT 1
- NoMethodError: undefined method `value' for #<Arel::SelectManager
- [Question] The sort_link does not refer to the search criteria in the object passed in the first argument.
- [Suggestion] Check for ransackable_scopes before checking attribute searches.
- Allow sorting using generated/virtual columns [Postgres]
- using cont on Oracle CLOB column is converting value to empty_clob()
- Ransack 4.0 allowlist be an optional config HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ransack.