Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
'value' was interpolated in a string for attribute_condition call (AR
Browse files Browse the repository at this point in the history
2.3.2 part) This was a mistake, getting SQL like "column = NULL" instead
of "column IS NULL".

Signed-off-by: Pete Deffendol <pete@mdsc.com>
  • Loading branch information
Loïc Guitaut authored and Pete Deffendol committed Jun 24, 2009
1 parent a7e18f1 commit f90868c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/mysql_spatial_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def self.get_rails2_conditions(attrs)
table_name = quoted_table_name
end
begin # this works in AR 2.3.2 and later versions, it might work in earlier versions - this way of checking avoids using version numbers
attribute_condition("#{table_name}.#{connection.quote_column_name(attr)}", "#{value}")
attribute_condition("#{table_name}.#{connection.quote_column_name(attr)}", value)
rescue ArgumentError # for some earlier versions of AR it definitely breaks
"#{table_name}.#{connection.quote_column_name(attr)} #{attribute_condition(value)}"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/post_gis_adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def self.get_conditions(attrs)
end
else
begin # this works in AR 2.3.2 and later versions, it might work in earlier versions - this way of checking avoids using version numbers
attribute_condition("#{table_name}.#{connection.quote_column_name(attr)}", "#{value}")
attribute_condition("#{table_name}.#{connection.quote_column_name(attr)}", value)
rescue ArgumentError # for some earlier versions of AR it definitely breaks
"#{table_name}.#{connection.quote_column_name(attr)} #{attribute_condition(value)}"
end
Expand Down

0 comments on commit f90868c

Please sign in to comment.