zdennis / ar-extensions
- Source
- Commits
- Network (26)
- Issues (6)
- Downloads (3)
- Wiki (1)
- Graphs
-
Branch:
master
-
I'm no rdoc whiz, but ar-extensions appears to have no good documentation and then, right there in the code is a big hunk o' rdoc love! What's going on?
Comments
-
In rails 2.3.3 they added a second parameter to sanitize_sql(). You can now pass the table_name as an option.
Comments
-
sanitize_sql_from_hash doesn't append nil to values array
0 comments Created 4 months ago by bvandenbosThe following call to sanitize_sql_from_hash yields invalid conditions:
sanitize_sql_from_hash({'state_id' => 3, 'county_id' => nil})And ends up throwing:
wrong number of bind variables (1 for 2)
There seems to be a specific check to make sure nil is not appended to the values array, which doesn't seem right, but I don't pretend to fully understand this method so it's likely I'm missing something. Seems like the following diff would take care of it:
diff --git a/ar-extensions/lib/ar-extensions/finders.rb b/ar-extensions/lib/ar-extensions/finders.rb index 874ba3c..374ac2a 100644 --- a/ar-extensions/lib/ar-extensions/finders.rb +++ b/ar-extensions/lib/ar-extensions/finders.rb @@ -63,7 +63,7 @@ class ActiveRecord::Base result = ActiveRecord::Extensions.process( key, val, self ) if result conditions << result.sql - values.push( result.value ) unless result.value.nil? + values.push( result.value ) else # Extract table name from qualified attribute names. attr = key.to_s @@ -91,4 +91,4 @@ class ActiveRecord::Base end end -end \ No newline at end of file +endComments
-
This page http://continuousthinking.com/tags/arext says ar-extensions in in 0.8.2, but this github repo and this page http://rubyforge.org/projects/arext/ say 0.9.2
Can the continuousthinking.com page link to one of these, or be kept up to date?
Comments
-
Rails 2.3.4 support: warning: default `to_a' will be obsolete
0 comments Created about 1 month ago by rudWhen using ar-extensions 0.9.2 with Rails 2.3.4 on ruby 1.8.6-1.8.7, the warning "default `to_a' will be obsolete" is often printed to STDERR.
The patch at [1] fixes this problem, please have a look.
[1] http://github.com/thillerson/ar-extensions/commit/fc0cab906ebc3766f22ab55e8e38a1c173187dbb
Regards
/Laust RudComments




