Displaying 5 results from an estimated 5 matches for "t_pk".
Did you mean:
t_k
2006 Mar 21
2
SQL bug in acts_as_taggable
Hi,
excuse me if this is off-topic and feel free to ingore it in case.
I''m using acts_as_taggable (the gem version) and found what to me
looks like a bug in this code from the method tags_count:
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(options[:conditions])}" if
options[:condit
ions]
sql << " G...
2006 Apr 04
5
How to implement tag clouds using plugin?
...taggable gem,anybody has done that using the
acts_as_taggable plugin?thanks!
btw:the code above uses the tag_count method,which is defined 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}, #{...
2006 Feb 13
0
count_as_taggable distinctly
...separator => '' '' }.merge(options)
tag_names =
ActiveRecord::Acts::Taggable.split_tag_names(options[:any] ||
options[:all], options[:separator])
raise "No tags were passed to :any or :all options" if
tag_names.empty?
o, o_pk, o_fk, t, t_pk, t_fk, jt = set_locals_for_sql
sql = "SELECT COUNT(DISTINCT #{o}.#{o_pk}) FROM #{jt}, #{o},
#{t} WHERE #{jt}.#{t_fk} = #{t}.#{t_pk}
AND (#{t}.name = ''#{tag_names.join("'' OR
#{t}.name=''")}'')
AND #{o}.#{o_p...
2006 Feb 28
0
acts_as_taggable vulnerable to attacks ?
...tions = {})
options = { :separator => '' '' }.merge(options)
tag_names = ActiveRecord::Acts::Taggable.split_tag_names(options[:any]
|| options[:all], options[:separator])
raise "No tags were passed to :any or :all options" if tag_names.empty?
o, o_pk, o_fk, t, t_pk, t_fk, jt = set_locals_for_sql
sql = "SELECT #{o}.* FROM #{jt}, #{o}, #{t} WHERE #{jt}.#{t_fk} =
#{t}.#{t_pk}
AND (#{t}.name = ''#{tag_names.join("'' OR #{t}.name=''")}'')
AND #{o}.#{o_pk} = #{jt}.#{o_fk}"
...
end
Notice tag_n...
2009 May 26
6
dump and import MySQL table w/ accents
I am switching to a composite primary key (string and user ID) from the Rails
conventional auto-incrementing integer primary ID. The table is large (2.5
million records) and I''d rather not discard the contents. The
composite_primary_key gem doesn''t appear to support altering the table with a
migration to do its magic, only creating a table from scratch. So I dumped
the table