Created
April 21, 2010 06:49
-
-
Save joshk/373513 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define_index do | |
... | |
# it should be this | |
indexes genres(:name) | |
# indexes special_tags(:name), :as => 'special_tags' | |
# and the ugly way to get special_tags working | |
indexes "GROUP_CONCAT(DISTINCT `special_tags_performances`.`name` SEPARATOR ' ')", :as => 'special_tags' | |
set_property :custom_joins => "LEFT OUTER JOIN `taggings` special_tags_performances_join ON (`performances`.`id` = `special_tags_performances_join`.`taggable_id` AND `special_tags_performances_join`.`taggable_type` = 'Performance') LEFT OUTER JOIN `tags` special_tags_performances ON (`special_tags_performances`.`id` = `special_tags_performances_join`.`tag_id`) AND `special_tags_performances`.`context` = 'special_tags'" | |
... | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment