Rails 4 and sanitize_sql_array #83

Closed
jviney opened this Issue Jan 18, 2013 · 5 comments

Projects

None yet

3 participants

@jviney
jviney commented Jan 18, 2013

The method visibility of sanitize_sql_array appears to have changed in Rails 4. I had to do this to my models allow pg_search to work.

class << self; public :sanitize_sql_array; end

Perhaps scope_options could be updated to reflect this change?

@nertzy
Collaborator
nertzy commented Jan 27, 2013

Long-term I want to use arel to build all the SQL, so that we don't have to ask the database adapter to do so much escaping.

For now, we can change it to use #send, but we are really just pushing the problem down the road until this private method changes without warning in a later version.

@nertzy
Collaborator
nertzy commented Jan 27, 2013

Also just to be clear on the upgrade plans, I will accept pull requests that help support Rails 4 without breaking Rails 3. But I don't plan on actively updating pg_search until a release candidate comes out.

Thanks for letting me know about this so that I can get to it when the time comes.

@orbanbotond

+1 It happened to mee too...

@nertzy
Collaborator
nertzy commented Mar 15, 2013

#87 fixed this on the HEAD of the Git repo, but a new gem hasn't been released yet.

I'll get a release out this weekend that has the fix, until then you could do this in your Gemfile

gem "pg_search", :github => "Casecommons/pg_search"

Be sure to remove the :github part once the gem is released to go back to the Rubygems version.

@nertzy nertzy closed this Mar 15, 2013
@nertzy
Collaborator
nertzy commented Apr 2, 2013

I'm reopening this because I have a fix coming soon that will remove all usages of sanitize_sql_array

@nertzy nertzy reopened this Apr 2, 2013
@nertzy nertzy closed this in aa35cab Apr 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment