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

another issue in find_options_for_tag_counts #4

Closed
jdbo opened this issue Apr 29, 2009 · 2 comments
Closed

another issue in find_options_for_tag_counts #4

jdbo opened this issue Apr 29, 2009 · 2 comments

Comments

@jdbo
Copy link

jdbo commented Apr 29, 2009

passed-in conditions are not being sanitized, causing some funky behavior with bound parameters; ex: :conditions => [ "foo.id IN (?)", [1,2,3,4,5] ] is being converted to SQL " foo.id in (?) AND 1 AND 2 AND 3 AND 4 AND 5"

here's a fix I applied that appears to be working:
before:
conditions = [
taggable_type,
taggable_id,
options[:conditions],
start_at,
end_at
]

after:
conditions = [
taggable_type,
taggable_id,
sanitize_sql(options[:conditions]),
start_at,
end_at
]

@dsmalko
Copy link

dsmalko commented May 11, 2009

I want to add permalink attribute to tag

{ :select => "#{Tag.table_name}.id, #{Tag.table_name}.name, COUNT(*) AS count",

should be

{ :select => "#{Tag.table_name}., COUNT() AS count",

@eet-nu
Copy link

eet-nu commented Dec 18, 2009

I think these issues have been fixed in recent versions. If not, please reply!

This issue was closed.
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