polymorphic-associations
Field, Foreign Key, That Can Reference Multiples Tables
I am developing a social network for an intranet, and I came across a problem [?]. I have the entities User and Business as main entities of the network.[详细]
2023-03-18 09:45 分类:问答Rails: Structuring a query involving a polymorphic association and STI
I\'m trying to find the 10 most recent comments on photos so I can integrate them into an activity feed on my Rails 3.0.3 application.[详细]
2023-03-17 15:16 分类:问答'Company' and 'Person': threat them similar... but gives problems when creating forms
Our company can have a contract with a person and a company. So the responsible \'party\' of a contract, can be both a person and a company.[详细]
2023-03-16 13:01 分类:问答Database schema design - how to store specific application settings against entities
I\'m trying to design some database tables to store configuration settings about certain entities and the applications they are associated with.I can get so far but have hit a \"brick wall\".I\'ll sho[详细]
2023-03-16 07:39 分类:问答Rails: What is the correct Association for these models?
What is the correct association for this problem? There are three models: Residents Parties Addresses Each Resident and Party has an Address[详细]
2023-03-15 02:09 分类:问答Help establishing a polymorphic relationship in the models
Models: class Thread < ActiveRecord::Base has_many :threaded, :through => :threaded, :foreign_key => :thread_id[详细]
2023-03-12 08:26 分类:问答Trouble with rspec test with a polymorphic class
I\'m using MongoMapper instead of ActiveRecord. I have a User model and a Task model. In the Task model, I have 2 attributes as follow:[详细]
2023-03-11 22:54 分类:问答polymorphic_path for custom collection route
I have the following route definition: resources :documents do collection do post :filter end end and the following model structure:[详细]
2023-03-09 01:10 分类:问答Polymorphic Assocations using Integer ID type fields
I have a table Foo that has a polymorphic belongs_to association called bar. The foos table has the standard bar_id column. However, instead of a string-based bar_type column, I have an integer bar_ty[详细]
2023-03-08 05:13 分类:问答Rails Polymorphic Association
I\'m having a difficult time grasping polymorphic associations in Rails. I have two models, Group and User.[详细]
2023-03-06 14:45 分类:问答