Quantcast
Channel: Lifelong Hacker ruby_on_rails » Lifelong Hacker
Viewing all articles
Browse latest Browse all 7

class_table_inheritance with acts_as_taggable

$
0
0
If I have: [source language=":ruby"] class Product < ActiveRecord::Base acts_as_taggable end [/source] [source language=":ruby"] class Subproduct < Product class_table_inheritance end [/source] [source language=":ruby"] def find_tagged_with!(list) find_by_sql([ "SELECT #{table_name}.* FROM #{table_name} " + "WHERE #{table_name}.#{primary_key} in (" + " SELECT taggable_id FROM taggings, tags " + " WHERE tags.id=taggings.tag_id " + " AND taggings.taggable_type = ? […]

Viewing all articles
Browse latest Browse all 7

Latest Images

Trending Articles





Latest Images