similar to: Association data clobbering (foreign keys too?)

Displaying 20 results from an estimated 500 matches similar to: "Association data clobbering (foreign keys too?)"

2006 Mar 15
1
push_with_attributes not inserting default values
I have a join table A_B with columns[a_id, b_id, c_data default 1, d_data default 1]. If I do: @aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0}) I find that the row inserted, has d_data set to 0 and not the default value specified in the database, which is 1. So I am having to explicitly set it using : @aobj.bobjs.push_with_attributes(@bobj,{:c_data => 0, :d_data => 1}). Is this
2006 Feb 28
4
multiple keys table
probablly a newbie question: Rails does not support a table with multiple keys ??? it seems that the ActiveRecord set_primary_key method can only set the column name... (hope i''m wrong there) example: table A - P.K id, string name table B - P.K id, string name table C - P.K a_id and b_id, both are also foreign keys. Thanks, Amir. -- Posted via http://www.ruby-forum.com/.
2008 Jul 04
2
How to make WHERE foo_id IN () query?
Hi, There are 3 models: A has_many :Cs B has_many :Cs C belongs_to A and B I got a single object of A and an array of B objects. How can I get all Cs that have a_id equal to object A.id *and* b_id that belongs to an object in Bs array? Regards --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2006 Dec 30
2
search on multiple table
Hello, I am trying to make a search, using acts_as_ferret on a has_and_belongs_to_many relation : class a < ActiveRecord::Base belongs_to :b has_and_belongs_to_many :c Joboffer.find_by_contents( query +b_id:1 ) is working fine but Joboffer.find_by_contents( query +c:1 ) is not working Here are the tables descriptions: Table a have field : id, b_id Table b have field : id,
2006 Jul 29
1
creating and storing records in Ruby
I''ve read through my RoR books and I can''t seem to find the solution. This is a pretty basic, easy, and practical application for RoR. If you guys know of any resources on the net to answer these questions let me know. Question 1: Basically, I have a many-to-many relationship that I want to add records to. I use something like this to add records in the A_B table:
2015 Aug 31
2
alloca combining, not (yet) possible ?
Hello since my broad RFC request didn't catch any responses, let me get a bit more into the nitty-gritty: I tried to get llvm (3.7) to optimize superflous allocas away, but so far I haven't figured out how. Is there no optimizer for this ? Should I adorn something with some attributes ? As far as I can tell no, but I am no llvm expert... For what I want to do, i will probably have a
2015 Aug 31
2
alloca combining, not (yet) possible ?
Caldarale, Charles R schrieb: > You have not provided us with the declaration for f(). Unless its argument is marked with the nocapture attribute, the compilation of g() cannot assume that f() has not retained a pointer to the x struct and is using it in the second call. > thanks a lot for the input. Yes, I forgot to that. The C function declaration would have been void f( struct a_b
2006 Nov 04
2
sql query in active record
hi all, if i want to write a query select * from a,b where a.b_id=b.id in active record using joins,condition how can i write that in docs i found for conditions you do by giving "?" and then the parameter eg. a.b_id=? but it takes b.id as string i.e a.b_id=''b.id'' i dont want that any suggestions thanks in advance regards gaurav -------------- next
2011 Apr 11
4
Printing field attributes outside the model.find_by_sql
Hi All, I have Model called pays..and it has fields like(id, topic, subject, created_at, b_id) and i also have a Model called suggests with fields(id, income, price, b_id) In my ruby on rails action or method Controller: def print_two_table @p = Pay.find_by_sql("SELECT p.id, p.topic, s.id, s.income, s.price FROM pays as P LEFT OUTER JOIN suggests AS s ON s.b_id = p.b_id WHERE
2015 Aug 28
2
RFC: alloca -- specify rounding factor for allocation (and more)
Hi sorta piggybacking on the other thread. I am looking for some feedback on how to implement the following idea in llvm. The really short version of the idea is this: * I want to alloca a field (record/struct), so that its size is an even multiple of 64 bytes. [^1] * This allocaed field will be exclusively used as an argument to functions * llvm should be aware of the extra bytes and should
2017 Aug 04
2
Why is as.function() slower than eval(call("function"())?
(Apologies if this is better suited for R-help.) On my system (macOS Sierra, late 2014 MacBook Pro; R 3.4.1, Homebrew build), I found that it is faster to construct a function using eval(call("function", ...)) than using as.function(list(...)). Example: make_fn_1 <- function(a, b) eval(call("function", a, b), env = parent.frame()) make_fn_2 <- function(a, b)
2012 Feb 14
3
Wildcard for indexing?
Hi, I'd like to know if it is possible to use wildcards * for indexing... E.g. I have a vector of strings. Now I'd like to select all elements which start with A_*? I'd also need to combine that with logical operators: "Select all elements of a vector that start with A (A*) OR that start with B (B*)" Probably that is quite easy. I looked into grep() which I think might
2012 Oct 14
4
listing the files in a directory using regular expressions
Hi Experts, This might be silly question that I am asking, but no way as I am new to R. I want to list the files in a directory using regular expression like A_B*_C*.csv etc. How to make this possible in R ? I tried like this list.files(dir=".", pattern="A_B*_C*.csv") but this gives no output, whereas list.files(.... pattern="*.csv") giving all the .csv files in
2006 Jan 27
1
"Conditional" match?
I have two datasets, big and small. s_date<-c(?2005-12-02?, ?2005-12-01?, ?2004-11-02?,?2002-10-05?,?2000-12-15?) s_id<-c(?a?,?a?,?b?,?c?,?d?) b_date<- c(?2005-12-31?, ?2005-12-31?, ?2004-12-31?,?2002-10-05?,?2001-10-31?,?1999-12-31?) b_id<-c(?a?,?b?,?c?,?d?,?e?,?c?) small<-data.frame(date_=as.Date(s_date),id=s_id) big<-data.frame(date_=as.Date(b_date),id=b_id) For each row
2017 Apr 09
2
[Bug] FTS invalid address parsing
Hi, i found another bug in FTS while parsing quoted-printable/base64-encoded sender's name inside 'From' header (again, i was figuring out why some of messages cannot be searched). Header: From: =?UTF-8?Q?A=2CB?= <test at example.com> Data send to Solr by Dovecot: <field name="from">A@, B &amp;lt;test at example.com&amp;gt;</field> Header:
2013 Jul 19
12
Rails 4 "belongs_to: record" association doesn't work
Hi, I discovered a weird behavior when using a "belongs_to: record" association in Rails 4. Given two models A and B: class A < ActiveRecord::Base belongs_to :record, class_name: ''B'', foreign_key: ''b_id'' end class B < ActiveRecord::Base end When creating A, it inserts a record in B and returns A with id of nil: irb(main):001:0>
2010 Oct 26
4
divide column in a dataframe based on a character
Hello, If I have a dataframe: example(data.frame) zz<-c("aa_bb","bb_cc","cc_dd","dd_ee","ee_ff","ff_gg","gg_hh","ii_jj","jj_kk","kk_ll") ddd <- cbind(dd, group = zz) and I want to divide the column named group by the "_", how would I do this? so instead of the first row being x
2007 Sep 23
3
Connecting a row of an unknown table to another row of an unknown table
Hello all, I''m currently designing a web app in Rails that lets me keep a directory of free/opensource computer games. Each game has attributes like name, website, review, etc., but each game can also be associated with a set of genres and gameplay elements. The main three tables I''m working with are "games", "genres", "elements",
2006 Jul 07
1
Multiple table SQL query in rails?
Table A has many table B''s. So the foreign key in table B is a_id. I want to select a single record from table A that does not have any table B''s. The problem is that the foreign key is in table B. Is there a simple way to do this with the find method in active record? Or do I need to select all and loop through them all and check until I find one? Thanks for your
2005 Mar 29
1
Problem installing packages and weird R site behaviour
Hi, I tried to install a package using the menu option and was presented a list filled with NA's. I then tried visiting the R site and each option on the side bar (eg. CRAN, Search,FAQ) sends me to the address attached below (NB: I left off the h in http). The first problem seems to be related to the second. Is anyone else experiencing this behaviour and how do I restore normal behaviour?