Created
October 31, 2012 02:52
-
-
Save jtroxel/3984535 to your computer and use it in GitHub Desktop.
Client of reusable Rails association
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
include CategoryGroup # Module to help a AR model associate to a category scoped by a "group" | |
has_many :categorizations, :as => :categorizable | |
has_many :categories, :through => :categorizations | |
category_group_association 'product', Category::PRODUCTS # create has_many for categorizations and categories, called product_ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment