similar to: Mass assignment to an AR that would call assignment methods.

Displaying 20 results from an estimated 50000 matches similar to: "Mass assignment to an AR that would call assignment methods."

2012 Mar 30
1
cancan breaks scoped mass assignment
Hi all, I just installed cancan on a new project and found out that it creates some problems with the new scoped mass assignment features of rails 3.2 . Basically, in my User model I create some attr_accessible attributes in order to avoid users to edit their roles or other sensitive information. From the administration I allow admins to edit those protected attributes by passing
2006 Apr 08
2
ActionView::Helpers::FormHelper instance methods should take an object reference rather than an object_name.
Hi ActionView::Helpers::FormHelper methods (e.g. #text_field, #check_box...) take object_name as an argument. From this argument they infer a name that is supposed to contains the reference to the relevant object. I can''t see why the FormHelper methods were designed that way. Compared to simply passing them a reference, the current way seems too complicated and an invitation to problems
2009 Nov 22
2
WARNING: Can't mass-assign these protected attributes: active
Hi, I''m trying to understand this error: WARNING: Can''t mass-assign these protected attributes: active I had this error before when creating a record.I did not mark the attibutes posted from the form as attr_accessible, so when the following line tries to execute it throwed an Warning in the log, and the record was not saved. @user = User.new(params[:user]) I find out that I
2006 Jul 22
2
How to SELECT from multiple talbes with AR#find and associations?
So I want to SELECT from multiple tables, so as to be able to do "SELECT FROM foo, bar WHERE foo.id=bar.id AND bar.baz=23". How do I do it with AR#find? Also, I need this for associations. has_many et. al. have :finder_sql, which is nice, but feels like a Pyrrhic: it''s basically doing the association in pure SQL, defeating the purpose of AR. -- -Alder
2006 Apr 27
1
validates_acceptance_of, virtual attributes and mass assign
Hi, I''ve a question concerning validates_acceptance_of method. Documentation says that the validated attribute is a virtual one, without a field in db. But when I add such an attribute to my form (say check_box(:xyz, :agreement)), it''s passed in params[:xyz][:agreement], but not assigned when calling Xyz.new(params[:xyz]), probably because corresponding field
2015 Jan 23
0
Wine release 1.7.35
The Wine development release 1.7.35 is now available. What's new in this release (see below for details): - Beginnings of support for OpenGL core contexts. - Initial support for glyph placement in DirectWrite. - Some more WBEM objects. - Various bug fixes. The source is available from the following locations: http://prdownloads.sourceforge.net/wine/wine-1.7.35.tar.bz2
2006 May 18
4
How do you delete a session variable?
Hi Let''s say we set session[:foo] = ''bar''. Now we want to remove the :foo key completely. How do you do that? Appearantly, session is a CGI::Session [1] instance, so it doesn''t have #delete like Hash. I tried: session[:foo] = nil But then debug(session) shows an empty :foo key. I''d like to remove that key, as my session is already pretty crowded. Is
2005 Aug 10
5
how to write assignment form of function
Dear All, where can I find information about how to write an assigment form of a function? For curiosity I tried to write a different form of the levels()-function, since the original method for factor deletes all other attributes of a factor. Of course, the simple method would be to use instead of levels(x) <- newlevels, attr(x, 'levels') <- newlevels. I tried the following: ##
2009 Aug 10
1
Call AR belongs_to association accessor ID method on object assignment
Hi, Haven''t been able to find this raised before but I''m sure it must have been. When assigning an object to a belongs_to association I would like it to call the *association*_id= method instead of directly updating the attributes array. This is because I want to modify the behaviour when assigning a particular object without writing separate methods for whether it''s
2006 Jul 26
2
newbie - HABTM confused...
I have a users table. I have a assignment table. and I have to log in to see my assignments. i can and I hasve a session id. I can make a new assignment and save my id in the user_id field of the assigment table. I want to share my assignments. so I can create a assignments_users table. this way I can have assignment 1 shared with user 1 and 2. and If I log in as user 1 or 2 I see the assignment.
2012 Apr 27
1
Can't mass-assign protected attributes even if I use attr_accessible
Hi, I''m working on a Rails 3.2.2 application which has JSON APIs and I use a CLI client for inserting some data. It works fine except for the Author model. When I try to create a new post (Post belongs_to :author and Author has_many :posts) I get the following error : <h1> ActiveModel::MassAssignmentSecurity::Error in PostsController#create </h1>
2011 Feb 13
3
[LLVMdev] conversion from 'const llvm::Value*' to 'llvm::Constant*'
Oh, I thought that after "codegening" cos(0) would get me double 1.0 (assigment is working for anything like: global a = 1/3 + 2 /3 for example) What would be the best way to make assigments involving functions, like global a = cos(0); without getting the assertion arising from InitVal = cast<Constant>(Init->Codegen()); ? I made some changes and now my code basically works,
2002 May 22
4
Re: assigning with operator '='.
I've just checked out Jens Oehlschlgel's posting as regards assigning with the ``='' operator. Yep, the phenomenon described really does happen. And yep, it sure seems ***very*** dangerous to me. Mind you, using ``='' as the assignment operator strikes me as being dangerous anyhow. Bad design decision by the S people (by John Chambers?) and R should ***not*** have
2009 Aug 07
2
create separate plots by factors
Hello, I am attempting to create several plots based on "site" (~300 total) and am having trouble with the code. I simply want to create a plot using the code, plot(year, peak), for the following dataset. I would like for each site to be plotted on a separate page and the plots saved in a directory. Would a "foreach" loop work? I tried a "by" statement, but
2013 May 02
0
nested forms in activeadmin is mass assigning
Here is my question<http://stackoverflow.com/questions/16325137/yet-another-cant-mass-assign-protected-attributes-address-post> . -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to
2017 Aug 23
0
MASS:::dropterm.glm() and MASS:::addterm.glm() should use ... for extractAIC()
Hi, I have sent this message to this list the July, 7th. It was about a problem in MASS package. Until now there is no change in the devel version. As the problem occurs in a package and not in the R-core, I don't know if the message should have been sent here. Anyway, I have added a copy to Pr Ripley. I hope it could have been fixed. Sincerely Marc Le 09/07/2017 ? 16:05, Marc Girondot via
2001 May 22
2
MASS data sets
I'm running R 1.2.2 under windows 98 on a Pentium 133 laptop. I can't seem to retrieve the package MASS data sets: > library(MASS) > data(wtloss) Warning message: Data set `wtloss' not found in: data(wtloss) > data(abbey) Warning message: Data set `abbey' not found in: data(abbey) And yet all the .rda files for the MASS datasets are in D:\Program
2008 Oct 30
1
Is possible, on biological grounds, suggest to fitdistr (MASS library) that the estimated parameters must be between two values?
Sorry if it is a silly question, I haven't found documentation on this and I don't know if it is possible. library(MASS) ## for fitdistr library(msm) ## for dtnorm #prepare truncated normal distribution dtnorm0 <- function(x, mean, sd , log = FALSE) { dtnorm(x, mean, sd, 105, 135, log) } set.seed(1) #Generate normal distribution with the TRUE population mean (day 106 of the
2010 Jan 30
1
Clash between r-cran-vr and r-cran-mass
[ Kevin sent this to me but agreed that it's better to have this discussed here. ] On 30 January 2010 at 11:35, Kevin Donnelly wrote: | I am using Ubuntu 9.10. Installing r-cran-latticist asks for r-cran-vr to | be installed as well, but this gives the following message: | E: /var/cache/apt/archives/r-cran-vr_7.2.47-1_i386.deb: trying to overwrite |
2009 Apr 16
1
Creating a list of database names for merge.rec
hello, I am trying to merge a large number of datasets into one using "merge.rec". > merge.rec(db, by.x = "X", by.y = "Y") > where "db" is my list of datasets. My problem is trying to create a code to create the list "db" for all the files without missing data: Currently my code looks like: if(any(is.na(X))){print(paste("there is