Skip to content

_cont on Integer column issues unexpected LIKE query #85

@SomeOfThemAreKillers

Description

@SomeOfThemAreKillers

Hi,

Using Ruby 1.9.3p0, Rails 3.2.2, MySQL 5.5.20, and Ransack 0.6.0, I'm unable to use '_cont' on an Integer column, while the database natively supports '%like%' queries there.

For the incoming search parameter "members_payments_amount_cont"=>"3" the SQL issued by Ransack is "WHERE (payments.amount LIKE 0)", which is obviously an issue.

If I use "members_payments_amount_eq"=>"3" the SQL is correct as shown here: "WHERE payments.amount = 3"

I suspect this is related to string vs. integer data types and am wondering if the behavior is intended or a bug?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions