4
5
6
7
8
9
10
11
12
|
# File 'lib/tagutils/categories/active_record.rb', line 4
def has_many_categories( opts={} )
puts " [CategoryDb.has_many_categories] adding categorizations n category has_many assocs to model >#{name}<"
has_many :categorizations, class_name: 'CategoryDb::Model::Categorization', :as => :categorizable
has_many :categories, class_name: 'CategoryDb::Model::Category', :through => :categorizations
scope :with_category, ->(category_key){ joins(:categories).where('categories.key' => category_key) }
end
|