Displaying 3 results from an estimated 3 matches for "participant_id".
2013 Feb 08
1
Problem with many to many relationship
Hi
I''m trying to create a many to many relationship between two models.
A User can be associated with many Incidents and vice versa.
class User < ActiveRecord::Base
include ActiveModel::ForbiddenAttributesProtection
has_many :incident_participants, foreign_key: "participant_id"
has_many :participated_incidents, through: :incident_participants
end
class Incident < ActiveRecord::Base
include ActiveModel::ForbiddenAttributesProtection
has_many :incident_participants, foreign_key: "participated_incident_id"
has_many :participants, through: :inci...
2009 May 12
4
has_many :through and scopes: how to mutate the set of associated objects?
...d my scope trickery doesn''t make it any better.
Now, let''s assume for a moment that participants was a plain has_many
association. Then it would be possible to write things like
m.participants.clear
m.participants << Person.find_by_name(''Steve McKing'')
m.participant_ids = params[:movie][:participants]
With the given has_many :through, none of these work, as Role object
won''t validate without a role type. Anyway, what I would like to write
is
m.participants.as(''actor'').clear
m.participants.as(''actor'') << Perso...
2009 Apr 01
1
Help with mixed-effects model with temporal pseudoreplication!
...atly appreciated!!!!
Here is the code I am using in R:
library(nlme)
datafile="http://people.rit.edu/rmh3093/mot.csv"
master1 = read.table(datafile,header=T)
Block=factor(master1$Block)
BlockOrder=factor(master1$Block_Order)
Replicate=factor(master1$Replicate)
Participant=factor(master1$Participant_ID)
Targets=factor(master1$Targets)
Entropy=factor(master1$Entropy)
CompletionTime=master1$Completion_Time
summary(lme(log(CompletionTime)~(Entropy*Targets),random=~1|Participant,method="ML"))
Thanks in advance!
-Ryan