method

sanitize_sql

Importance_3
Ruby on Rails latest stable (v7.1.3.2) - 3 notes - Class: ActiveRecord::Base

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v3.1.0) is shown here.

These similar methods exist in v7.1.3.2:

sanitize_sql(condition, table_name = self.table_name) protected

Alias for ActiveRecord::Base::sanitize_sql_for_conditions

Register or log in to add new notes.
January 2, 2009 - (<= v2.2.1)
3 thanks

What to use instead

For versions 2.0+, use ActiveRecord::Base::sanitize_sql_array

January 23, 2009
1 thank

Alternate for Rails 2.0

Obviously these methods are protected so usage in an app is discouraged. But if you need to use it anyway for some reason Rails 2.0 also has sanitize_sql_for_conditions which operates exactly like sanitize_sql used to (i.e. it determines if it needs to be processed as an array or hash). So if you are going to blow by the protected status might as well use the easier version. :)

October 13, 2010 - (v2.1.0 - v3.0.0)
1 thank