-
-
Notifications
You must be signed in to change notification settings - Fork 829
Milestone
Description
I have this Ransack configuration long time ago.
Ransack.configure do |config|
config.add_predicate 'in_list',
arel_predicate: 'in',
formatter: ->(v) { v&.split(';').join("','") }
end
Calling:
Table.ransack(column_in_list: 'test;othertest').result.to_sql
Expected
WHERE table.column IN ('test', 'othertest')
Actual
WHERE table.column IN ('test'',''othertest')
There is an extra single quote added by Ransack or ActiveRecord when building the query. This breaks the SQL syntax.
What I can confirm is, it worked before.
Environment
Rails: 7.x
Ransack: 4.x
Ruby: 3.x