specify taggable type on acts

So here's the deal, I've been using acts-as-taggable-on on my models but at one point during my application, I had to pull out the models and put them in a gem, so that can I re-use them on several applications that share the structure. The thing is that my gem references the namespaced models IE.

VideoapiModel::Category.new

or

VideoapiModel::Video.new

rather than just the model itself ( as it was before)

Video.new 

or

Category.new

My problem is that now the data that i had before it's "corrupt" because when I use the .tag_list method it would search for taggings with the taggable_type of VideoapiModel::Video instead of just Video as it was before.

therefor, my question is: Is there a way to specify the taggable_type on the tags query when using acts-as-taggable-on?

链接地址: http://www.djcxy.com/p/36002.html

上一篇: 自定义验证与行为

下一篇: 在行为中指定标签类型