Using with Polymorphic associations?

21 views
Skip to first unread message

millisami

unread,
Jul 19, 2010, 3:05:52 PM7/19/10
to pickle
Hi,
How can I use pickle with polymorphic associations?

vendor.rb
has_many :activities, :as => :tracker

campaign.rb
has_many :activities, :as => :trackable


class Activity < ::ActiveRecord::Base
belongs_to :tracker, :polymorphic => true
belongs_to :trackable, :polymorphic => true
end

I want to assert it!
And an activity should exist with vendor: the first vendor, client:
the first client

Is this the way?

Ian White

unread,
Jul 19, 2010, 3:17:24 PM7/19/10
to pickle-...@googlegroups.com
Hi,

The following will work:

And an activity should exist with trackable: the first vendor

Cheers,
Ian

Reply all
Reply to author
Forward
0 new messages