Displaying 1 result from an estimated 1 matches for "peoplecampaign".
Did you mean:
people_campaigns
2008 Feb 12
8
has_many through question
...exported. If they are exported then update with
people_campaigns.exported=1
what I did is (except for the fastercsv lines):
people = Person.find(:all)
people.each do |person|
campaigns = person.campaign
campaings.each do |campaign|
if campaign.name == params[:campaignName]
tester = PeopleCampaign.find(:first,
:conditions => ["person_id=? and
campaign_id=? and isnull(exported)",person.id,campaign.id]
)
if tester
#print all to fastercsvlines
tester.exported = 1
tester.save
en...