Skip to content
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

Apostrophes not inserted #103

Closed
jdelStrother opened this issue Jun 3, 2019 · 2 comments
Closed

Apostrophes not inserted #103

jdelStrother opened this issue Jun 3, 2019 · 2 comments

Comments

@jdelStrother
Copy link
Contributor

Is it intentional that Riddle::Query::Insert strips apostrophes from its values?

irb> Riddle::Query::Insert.new(:posts, ["title"], ["jon's stuff"]).to_sql
=> "INSERT INTO posts (`title`) VALUES ('jons stuff')"

I'm not sure if Riddle ought to be fixed to escape the apostrophe appropriately, or if I need to strip apostrophes from search queries when trying to find them later with ThinkingSphinx

@pat
Copy link
Owner

pat commented Jun 13, 2019

Belated response, but this really does feel like a bug to me. I'll look into having Riddle escape apostrophes instead of stripping them out.

pat added a commit that referenced this issue Jul 27, 2019
The previous behaviour was to remove them. Instead, we're now using the escaping behaviour that's already available. As first raised in #103.
@pat
Copy link
Owner

pat commented Jul 28, 2019

Took me longer than I wanted to sort this out, but I've changed the behaviour so they're properly escaped (and thus Sphinx's character settings can decide what the right behaviour is) rather than removed, and this is available in the freshly-published v2.4.0 release.

@pat pat closed this as completed Jul 28, 2019
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

No branches or pull requests

2 participants