You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe I'm a bit annoying but here is issue following association can't be simply deleted without instatiating or iterating through every record
class Content < ActiveRecord::Base
belongs_to :composite, :polymorphic => true, :dependent => :destroy
end
class UploadedFile < ActiveRecord::Base
has_one :content, :as => :composite
end
class ExternalLink < ActiveRecord::Base
has_one :content, :as => :composite
end
Main problem here - association class can't be detected using Model.reflect_on_all_associations.
I don't have any good ideas how resolve this issue: some special strategy should be applyed in case of belongs_to :something, :polymorphic => true, :dependent => :destroy
The text was updated successfully, but these errors were encountered:
association class can't be detected using Model.reflect_on_all_associations
I am not familiar with what data that will give you in this scenario but if the association can be detected (just not the class) then I am sure there should be some way or another to determine the class.
For example, when you say, Content.first.composite, I wonder what rails uses internally to determine the class.
I won't have time to look at this any time soon unfortunately.
Maybe I'm a bit annoying but here is issue following association can't be simply deleted without instatiating or iterating through every record
class Content < ActiveRecord::Base
belongs_to :composite, :polymorphic => true, :dependent => :destroy
end
class UploadedFile < ActiveRecord::Base
has_one :content, :as => :composite
end
class ExternalLink < ActiveRecord::Base
has_one :content, :as => :composite
end
Main problem here - association class can't be detected using Model.reflect_on_all_associations.
I don't have any good ideas how resolve this issue: some special strategy should be applyed in case of belongs_to :something, :polymorphic => true, :dependent => :destroy
The text was updated successfully, but these errors were encountered: