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

find_related_tags broken for many contexts #628

Closed
d4rky-pl opened this issue Feb 10, 2015 · 0 comments
Closed

find_related_tags broken for many contexts #628

d4rky-pl opened this issue Feb 10, 2015 · 0 comments

Comments

@d4rky-pl
Copy link
Contributor

I have a model called Point that has three taggables:

  acts_as_taggable
  acts_as_taggable_on :concepts, :taxonomies

Now whenever I call find_related_concepts on model, generated SQL looks like this:

SELECT  points.*, COUNT(tags.id) AS count FROM points, tags, taggings  
WHERE (points.id != 199 AND points.id = taggings.taggable_id 
AND taggings.taggable_type = 'Point' 
AND taggings.tag_id = tags.id 
AND tags.name IN ('tag1', 'tag2', 'tag3')) 
GROUP BY points.id, /* other columns */ 
ORDER BY points.updated_at DESC, points.created_at DESC, count DESC

This gives me results for every related tag (rather than concepts only) because it's missing context constraint.

d4rky-pl added a commit to d4rky-pl/acts-as-taggable-on that referenced this issue Feb 10, 2015
@seuros seuros closed this as completed in 3f9632a Feb 11, 2015
rikettsie pushed a commit to rikettsie/acts-as-taggable-on that referenced this issue Mar 1, 2015
rikettsie added a commit to rikettsie/acts-as-taggable-on that referenced this issue Mar 1, 2015
added migration and rake task

added rake rule and a config parameter to force binary collation (MySql)

Added test for binary string collation

included migration in test

added self to migration

moved binary collation migration to 'without unique index' context

moved binary collation parameter from migration to app configuration

(typo) removed import

(typo) missing Configuration class name

force_binary_collation change can be set by MySql users only

(typo) method name using_mysql?

when force_binary_collation is false, strict_case_match is not touch

force_binary_collation not used in context without_unique_index

updated README and simplified rake test

rake task calls Configuration function

updated README

Gemfile cleaned

cleaned READEME.md

Added test for binary string collation

(typo) removed import

(typo) method name using_mysql?

when force_binary_collation is false, strict_case_match is not touch

force_binary_collation not used in context without_unique_index

Gemfile cleaned

updated CHANGELOG

added migration and rake task

Add context constraint to find_related_* methods. Fixes mbleigh#628

version bump

added rake rule and a config parameter to force binary collation (MySql)

added rake rule and a config parameter to force binary collation (MySql)

applied changes
rikettsie added a commit to rikettsie/acts-as-taggable-on that referenced this issue Mar 1, 2015
added migration and rake task

added rake rule and a config parameter to force binary collation (MySql)

Added test for binary string collation

included migration in test

added self to migration

moved binary collation migration to 'without unique index' context

moved binary collation parameter from migration to app configuration

(typo) removed import

(typo) missing Configuration class name

force_binary_collation change can be set by MySql users only

(typo) method name using_mysql?

when force_binary_collation is false, strict_case_match is not touch

force_binary_collation not used in context without_unique_index

updated README and simplified rake test

rake task calls Configuration function

updated README

Gemfile cleaned

cleaned READEME.md

Added test for binary string collation

(typo) removed import

(typo) method name using_mysql?

when force_binary_collation is false, strict_case_match is not touch

force_binary_collation not used in context without_unique_index

Gemfile cleaned

updated CHANGELOG

added migration and rake task

Add context constraint to find_related_* methods. Fixes mbleigh#628

version bump

added rake rule and a config parameter to force binary collation (MySql)

added rake rule and a config parameter to force binary collation (MySql)

applied changes

added migration and rake task
rikettsie pushed a commit to rikettsie/acts-as-taggable-on that referenced this issue Mar 1, 2015
markedmondson pushed a commit to markedmondson/acts-as-taggable-on that referenced this issue Jun 18, 2015
* master: (26 commits)
  mbleigh#623 collation parameter is ignored if it generates an exception.
  Update release date for 3.5.0
  Update README.md
  Changing ActsAsTaggable to ActsAsTaggableOn
  version 3.5.0
  Add context constraint to find_related_* methods. Fixes mbleigh#628
  added rake rule and a config parameter to force binary collation (MySql)
  added migration and rake task
  mbleigh#623: added manual column alter suggestion to fix special characters in tags (MySql only)
  version bump
  Add context constraint to find_related_* methods. Fixes mbleigh#628
  Fixing typo in docs with strong typing
  Namespaced TagList usage in a customer parser
  version bump, test on ruby 2.2, remove rails edge from matrix.
  clears column cache on reset_column_information resolves mbleigh#621
  Use the new build env on Travis
  Update README.md
  sha_prefix should not be random
  Fix milestones link
  Meet interface expectation for active record.
  ...
tekniklr pushed a commit to tekniklr/acts-as-taggable-on that referenced this issue Mar 19, 2021
tekniklr pushed a commit to tekniklr/acts-as-taggable-on that referenced this issue Mar 19, 2021
added migration and rake task

added rake rule and a config parameter to force binary collation (MySql)

Added test for binary string collation

included migration in test

added self to migration

moved binary collation migration to 'without unique index' context

moved binary collation parameter from migration to app configuration

(typo) removed import

(typo) missing Configuration class name

force_binary_collation change can be set by MySql users only

(typo) method name using_mysql?

when force_binary_collation is false, strict_case_match is not touch

force_binary_collation not used in context without_unique_index

updated README and simplified rake test

rake task calls Configuration function

updated README

Gemfile cleaned

cleaned READEME.md

Added test for binary string collation

(typo) removed import

(typo) method name using_mysql?

when force_binary_collation is false, strict_case_match is not touch

force_binary_collation not used in context without_unique_index

Gemfile cleaned

updated CHANGELOG

added migration and rake task

Add context constraint to find_related_* methods. Fixes mbleigh#628

version bump

added rake rule and a config parameter to force binary collation (MySql)

added rake rule and a config parameter to force binary collation (MySql)

applied changes

added migration and rake task
tekniklr pushed a commit to tekniklr/acts-as-taggable-on that referenced this issue Mar 19, 2021
dazralsky pushed a commit to dazralsky/acts-as-taggable-on that referenced this issue Aug 21, 2023
dazralsky pushed a commit to dazralsky/acts-as-taggable-on that referenced this issue Aug 21, 2023
added migration and rake task

added rake rule and a config parameter to force binary collation (MySql)

Added test for binary string collation

included migration in test

added self to migration

moved binary collation migration to 'without unique index' context

moved binary collation parameter from migration to app configuration

(typo) removed import

(typo) missing Configuration class name

force_binary_collation change can be set by MySql users only

(typo) method name using_mysql?

when force_binary_collation is false, strict_case_match is not touch

force_binary_collation not used in context without_unique_index

updated README and simplified rake test

rake task calls Configuration function

updated README

Gemfile cleaned

cleaned READEME.md

Added test for binary string collation

(typo) removed import

(typo) method name using_mysql?

when force_binary_collation is false, strict_case_match is not touch

force_binary_collation not used in context without_unique_index

Gemfile cleaned

updated CHANGELOG

added migration and rake task

Add context constraint to find_related_* methods. Fixes mbleigh/acts-as-taggable-on#628

version bump

added rake rule and a config parameter to force binary collation (MySql)

added rake rule and a config parameter to force binary collation (MySql)

applied changes

added migration and rake task
dazralsky pushed a commit to dazralsky/acts-as-taggable-on that referenced this issue Aug 21, 2023
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

1 participant