Displaying 1 result from an estimated 1 matches for "tags_join_model".
2006 Apr 04
5
How to implement tag clouds using plugin?
...d in the
gem:
def tags_count(options = {})
options = {:order => ''count DESC''}.merge(options)
o, t, o_pk, o_fk, t_pk, t_fk = table_name,
tag_model.table_name, primary_key, taggable_foreign_key,
tag_model.primary_key, tag_foreign_key
jt = tags_join_model ? tags_join_model.table_name :
tags_join_table
sql = "SELECT #{t}.#{t_pk} AS id, #{t}.name AS name, COUNT(*)
AS count FROM #{jt}, #{o}, #{t} WHERE #{jt}.#{t_fk} = #{t}.#{t_pk}
AND #{jt}.#{o_fk} = #{o}.#{o_pk}"
sql << " AND #{sanitize_sql(o...