Created
February 6, 2014 14:38
-
-
Save SemperEadem/8845405 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
<% categories.each do |category| %> | |
<% card_ids = [] %> | |
<% cards = Card.joins(:card_types).where(card_types: {id: category.card_type_ids}) %> | |
<% cards.find_each do |card| %> | |
<% card_ids << card.id unless card_ids.include?(card.id) %> | |
<% end %> | |
<% category_cards = @main_cards.where(card_id: [card_ids]) %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment