This is a Rails开发者_开发知识库 3 application. I have images that can be tied to either a Product or a Brand.A product has an identifier and a Brand has a name.
class User < ActiveRecord::Base has_many :followings, :as => :followable, :dependent => :destroy, :class_name => \'Follow\'
I have two tables called \'events\' and \'topics\' each table can have many comments. What I need to do is list all the events and topics with the amount of comments for each row. I\'ve managed to re
I have a simple polymorphic association #comment.r开发者_JAVA百科b belongs_to :commentable, :polymorphic => true
I have a metric table that I expect to be very large.It has a polymorphic association so that it can belongs_to other models that want to record some metric.I typically index association columns like
Below I have outlined the structure of a polymorphic association. In VacationsController I put some comments inline describing my current issue. However, I wanted to post this to see if my whole appro
I have a need in my app to allow users to bookmark a post.They should only be able to create one bookmark per post.I\'ve set up my polymorphic association like so:
I would like set up a polymorphic relation with accepts_nested_attributes_for. Here is the code: class Contact <ActiveRecord::Base
Today I was faced with a challenge to create different behaviors for my shopping cart model. That\'s because the owner of the online shopping wanted to create some promotions like buy 1, get 5 or get
I have 2 polymorphic associations through which I need to query. I have a news_article table which has a polymorphic association to teams, play开发者_如何学Cers, etc. Those teams, players, etc have