polymorphic-associations
Find condition needs refactoring/optimising on polymorphic association
I\'m building a recommendation method for users in my project. Users generate interest records whenever they view, create, comment or interact with objects (weighted depending on the action).[详细]
2023-02-21 22:02 分类:问答What is the best way to keep this schema clear?
Currently I\'m working on a RFID project where each tag is attached to an object. An object could be a person, a computer, a pencil, a box or whatever it comes to the mind of my boss.[详细]
2023-02-20 15:18 分类:问答How to make has many through polymorphic associations dependent in rails 3?
I have a polymorphic relationshi开发者_运维百科p in rails 3 and i am trying to make the through table dependent. What is the best way to handle that?Would help to have some example code that you are t[详细]
2023-02-20 13:08 分类:问答How can I make a polymorphic connection be dependent?
I am trying to make my image_maps get destroyed when either a product 开发者_如何学编程or image is deleted. Here is the code.[详细]
2023-02-19 04:19 分类:问答has_one to a polymorphic association
I have the following: class Car < ActiveRecord::Base has_one :driver end class Driver < ActiveRecord::Base[详细]
2023-02-18 16:54 分类:问答Polymorphic many-to-many association error in Ruby On Rails 3
I am struggling with a polymorphic many-to-many association in rails 3. My Article model looks like this:[详细]
2023-02-18 08:16 分类:问答RoR: STI / MTI / Mixin confusion
i have a problem which is i believe basic for most of the RoR developers. In fact, it\'s more about \"understanding\" than really programming it (i have already been programming a few modules to be ab[详细]
2023-02-18 01:33 分类:问答Rails: organizations that have admins and moderators and users
Existing models: class Organization < ActiveRecord::Base has_many :admins has_many :users, :through => :admins[详细]
2023-02-16 02:00 分类:问答Find all records of a certain type in Polymorphic table using ActiveRecord in Rails 3
I have a table Category that is a polymorphic model for a bunch of other models. For instance model Address has shipping, billing,[详细]
2023-02-13 18:04 分类:问答Polymorphic associations in views
How do I display my polymorphic associations in my view? I have the following model. class Blog < ActiveRecord::Base[详细]
2023-02-13 12:35 分类:问答