-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Is there an equivalent to Rails-like polymorphic associations in Doctrine? I'm trying to do something similar to: http://railscasts.com/episodes/154-polymorphic-association
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Is it possible to eagerly load polymorphic association using Linq and NH?
For example: Company is base class, Department is inherited from Company, and Company has association Employees to the User (one-to-many) and also association to the Country (many-to-one).
Here is mapping part related to inherited…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Consider a class:
class Link < ActiveRecord::Base
has_many :link_votes, :as => :vote_subject, :class_name => 'Vote'
has_many :spam_votes, :as => :vote_subject, :class_name => 'Vote'
end
The problem is, when I'm adding a new vote with @link.link_votes << Vote.new the vote_subject_type…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi all!
I'm having trouble with the following code:
User < AR
acts_as_authentic
belongs_to :owner, :polymorphic => true
end
Worker < AR
has_one :user, :as => :owner
accepts_nested_attributes_for :user
end
Employer < AR
has_one :user, :as => :owner
accepts_nested_attributes_for…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
When I render XML with an :include clause for a polymorphic association I have, it doesn't work. I end up with the XML returning the object pointers instead of the actual objects, like:
<posts>
#<Comment:0x102ed1540>#<Comment:0x102ecaa38>#<Comment:0x102ec7fe0>#<Comment:0x102ec3cd8>
</posts>
Yet…
>>> More