similar to: ActiveRecord: Attribute Setter for belongs_to relation attribute

Displaying 20 results from an estimated 8000 matches similar to: "ActiveRecord: Attribute Setter for belongs_to relation attribute"

2008 Feb 08
2
update_Attributes stale Object error
Hi, IN one of my unit tests I get an ActiveRecord::StaleObjectError: Attempted to update a stale object object.save! in object I have apart from other stuff an after_save method, which calls object.assosication.update_attributes(...) If I remove that line from my code my tests succeeds. Unfortunetly, I do not understand why an update_attributes call can generate an StaleObjectError. Maybe
2006 Sep 22
1
url_for params
Hi, url_for has a nice way of using the current ''params'' object to fill in default parameters in a route. For example, map.connect '':controller/:action/:id/'' with <%= url_for :action => ''my_action'' %> will redirect to the current controller. All very good. However, I sometimes want a url_for() which includes current parameters
2009 Aug 17
1
Problem with setter override on ActiveRecord
(This message was originally written on StackOverflow -- the formatting is much prettier there -- http://stackoverflow.com/questions/1283046/problem-with-setter-override-on-activerecord) This is not exactly a question, it''s rather a report on how I solved an issue with write_attribute when the attribute is an object, on Rails'' Active Record. I hope this can be useful to others
2006 Mar 02
3
merge with symbol problem
Hi, It''s a little bit annoying to me, I can''t understand the following: If I merge a value to the params hash with: params => params.merge :value => new_value the params[:value] doesn''t change, but if I use string instead of a symbol like: params => params.merge "value" => new_value it works. Somebody plz tell me why... Abbath
2018 Apr 11
1
[PATCH] v2v: linux: correctly update resume=/dev/device entries (RHBZ#1532224)
When updating the device names to the new names, handle GRUB_CMDLINE entries (typically in grub2 configuration files) correctly: loop over the whole configuration value, and replace each occurrency of resume=/dev/device found. The actual code is moved away from replace_if_device, since this function now does only the actual replacement of the device string. --- v2v/convert_linux.ml | 38
2008 May 07
1
Assigning to the foreign key on a belongs_to association
I''ve encountered what seems like an odd omission in the behaviour of belongs_to associations: if you assign to the foreign key attribute, it doesn''t update the associated object (or mark a previously loaded one as stale) until you explicitly save or reload it. Let''s say we have a Company model, which belongs_to :city : >> torchbox =
2009 Jan 09
1
Calculating p-values from your own distribution as an array
Hi - If I have a hypothetical distribution as an array distribution<-c(0,1,2,3,4,5,6,7,8,9) and I want to find the probability there is a value smaller than a new value. new_value<-4 (such that I'd get this type of output) new_value p-value 4 0.5 3.4 0.4 3 0.4 0 0.1 -1 0.0 Thanks for the help, I bet this is really easy... :/ Stephen -- The Wellcome Trust Sanger Institute is
2008 Jul 23
3
Validation method vs. After Save & Rollback
Hey Guys, Again, I am just learning Rails, so I am asking advice here. I have a model called Company which has many Owners. The Owners model indicates the name of the owner and their share (as a percentage) of the company. The total shares for any one company can not be more than 100%. So if I have 10 owners each with 10% of the company and I update one of the owners and set their share to 11%,
2008 Nov 17
1
Type III ANOVA of package car depends on factor level order
## Question1: How to define IV with interaction alone, without main effects? ## Question2: Should Type III ANOVA in package car be independent of the factor level order? ## data from http://www.otago.ac.nz/sas/stat/chap30/sect52.htm drug <- c(t(t(rep(1,3)))%*%t(1:4)); disease <- c(t(t(1:3)) %*% t(rep(1,4))); y <- t(matrix(c( 42 ,44 ,36 ,13 ,19 ,22 ,33 ,NA ,26 ,NA ,33 ,21 ,31 ,-3 ,NA
2004 Jul 14
1
New dynamic window patch (with limits)
As before, it is described on our website. This should apply fairly cleanly to both portable and openbsd ssh. http://www.psc.edu/networking/hpn-ssh/ Only in openssh-3.8.1p1-dynwindow: Makefile diff -u openssh-3.8.1p1/buffer.c openssh-3.8.1p1-dynwindow/buffer.c --- openssh-3.8.1p1/buffer.c 2003-11-21 07:56:47.000000000 -0500 +++ openssh-3.8.1p1-dynwindow/buffer.c 2004-07-12 07:49:29.000000000
2018 May 04
2
Regression model fitting
Hi all , I have a dataframe (Hypertension) with following headers :- > Hypertension ID Hypertension(before drug A) Hypertension(On drug A) On drug B? Healthy diet? 1 160 90 True True 2 190
2012 Mar 20
2
Reshaping data from long to wide without a "timevar"
Hello All, I was wondering if it's possible to reshape data from long to wide in R without using a "timevar". I've pasted some sample data below along with some code. The data are sorted by Subject and Drug. I want to transpose the Drug variable into multiple columns in alphabetical order. My data have a variable called "RowNo" that functions almost like a
2018 Mar 05
2
data analysis for partial two-by-two factorial design
Hi Bert, I am very sorry to bother you again. For the following question, as you suggested, I posted it in both Biostars website and stackexchange website, so far no reply. I really hope that you can do me a great favor to share your points about how to explain the coefficients for drug A and drug B if run anova model (response variable = drug A + drug B). is it different from running three
2018 Mar 05
0
data analysis for partial two-by-two factorial design
> On Mar 5, 2018, at 8:52 AM, Ding, Yuan Chun <ycding at coh.org> wrote: > > Hi Bert, > > I am very sorry to bother you again. > > For the following question, as you suggested, I posted it in both Biostars website and stackexchange website, so far no reply. > > I really hope that you can do me a great favor to share your points about how to explain the
2018 Mar 05
0
data analysis for partial two-by-two factorial design
Hi Bert and David, Thank you so much for willingness to spend some time on my problem!!! I have some statistical knowledge (going to get a master in applied statisitics), but do not have a chance to purse a phD for statistics, so I am always be careful before starting to do analysis and hope to gather supportive information from real statisticians. Sorry that I did not tell more info about
2007 Jul 05
3
summarizing dataframe at variable/factor levels
All, Is there an efficient way to apply say "mean" or "median" to a dataframe according to say all combinations of two variables in the dataframe? Below is a simple example and the outline of a "manual" solution that will work but is not very efficient (could also generalize this to a function). Searched the archives and docs but didn't see anything close to
2006 May 30
1
max / pmax
Hello R users, I am relatively new to R and cannot seem to crack a coding problem. I am working with substance abuse data, and I have a variable called "primary.drug" which is considered the drug of choice for each subject. I have just a few missing values on that variable. Instead of using a multiple imputation method like chained equations, I would prefer to derive these
2018 Mar 05
0
data analysis for partial two-by-two factorial design
> On Mar 5, 2018, at 2:27 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > > David: > > I believe your response on SO is incorrect. This is a standard OFAT (one factor at a time) design, so that assuming additivity (no interactions), the effects of drugA and drugB can be determined via the model you rejected: >> three groups, no drugA/no drugB, yes drugA/no drugB,
2018 Mar 05
0
data analysis for partial two-by-two factorial design
> On Mar 5, 2018, at 3:04 PM, Bert Gunter <bgunter.4567 at gmail.com> wrote: > > But of course the whole point of additivity is to decompose the combined effect as the sum of individual effects. Agreed. Furthermore your encoding of the treatment assignments has the advantage that the default treatment contrast for A+B will have a statistical estimate associated with it. That was a
2006 Jul 07
4
How to change the type of segments ends?
Hi, I am trying to plot odds ratios and the corresponding confidence intervals in horizontal segments. It would be ideal if the confidence interval segment can be drawn with little vertical bars at both ends. I have tried very hard to change the type of ends by using 'lend' arguments, but cannot make it. I even tried 'arrows()', but still failed. Following is the code I use: