Open
Description
Is this the intended behavior?
class Lesson < ApplicationRecord
enum :status, {
one: 1,
two: 2,
three: 3
}
class << self
def ransackable_attributes(auth_object = nil)
["status"]
end
end
end
Lesson.ransack({ "status_eq" => "two" }).result
# I expected: SELECT * FROM lessons WHERE status = 2
But the actual query is:
SELECT "lessons".* FROM "lessons" WHERE "lessons"."status" = 0
I understand that defining a ransacker
in the model can be used as a workaround.
That said, if this is considered a bug, I would truly appreciate any fix or guidance.
If there's any way I could contribute to resolving it, I’d be more than happy to help.
I’m not very fluent in English, so I apologize if my words sounded rude
Metadata
Metadata
Assignees
Labels
No labels