polymorphic-associations
Suggestions on how to track tag count for a particular object
I\'m looking for suggestions on how to track the number of tags associated with a particular object in Rails. I\'m using acts_as_taggable_on and it\'s working fine. What I would like to be able to do[详细]
2023-01-02 17:00 分类:问答jpa join query on a subclass
I have the following relationships in JPA (hibernate). Object X has two subclasses, Y and Z. Object A has a manyToOne relationship to object X. (Note, this is a one-sided relationship so object X ca[详细]
2023-01-02 12:52 分类:问答How to model has_many with polymorphism?
I\'ve run into a situation that I am not quite sure how to model. EDIT: The code below now represent a working solution. I am still interested in nicer looking solutions, though.[详细]
2023-01-02 12:39 分类:问答join same rails models twice, eg people has_many clubs through membership AND people has_many clubs through committee
Models: * Person * Club Relationships * Membership * Committee People should be able to join a club (Membership)[详细]
2023-01-02 11:04 分类:问答How to combine two models in one RoR acts_as_tree treeview?
I have two simple models each with acts_as_tree, say Departments and Employees. My goal is to create a treeview combining both models in to one overall tree, like so:[详细]
2023-01-01 14:01 分类:问答Rails: Polymorphic User Table a good idea with AuthLogic?
I have a system where I need to login three user types: customers, companies, and vendors from one login form on the home page.[详细]
2022-12-31 20:56 分类:问答Rails preventing duplicates in polymorphic has_many :through associations
Is there an easy or at least elegant way to prevent duplicate entries in polymorphic has_many through associations?[详细]
2022-12-31 12:26 分类:问答Associating Models with Polymorphic
I am trying to associate Contacts with Classes but as two different types. Current_classes and Interested_classes.[详细]
2022-12-31 04:46 分类:问答How do I check if an instance has an object to skip displaying the values?
I have created a polymorphic association around a model called status. Some contacts will have a status associate开发者_开发问答d with it.Many won\'t.[详细]
2022-12-30 21:51 分类:问答Ruby on Rails: How can I authenticate different user types from one place?
This is my first post on Stack Overflow. I am trying to build a system that authenticates three types of user with completely different site experiences: Customers, Employers, and Vendors.[详细]
2022-12-30 13:35 分类:问答