similar to: search on multiple table

Displaying 20 results from an estimated 900 matches similar to: "search on multiple table"

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/.
2006 May 17
2
Association data clobbering (foreign keys too?)
Can someone please confirm or correct the following statements? If I have the following tables create table as (id int, [...], b_id int); create table bs (id int, [...], a_id int); create table as_bs (a_id int, b_id int); and the associations woould be defined like this class A << ... habtm :bs belongs_to :b end so my Model A has a habtm collection of Bs *plus* a direct
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 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
2007 Sep 09
2
Batch mode scenario ("use case")
Hello, I came up with this scenario of the use of batch mode while thinking of back-up schemes to use for myself. However, it could be that the last step needed in this scenario is not supported by rsync! Here's the scenario: At one time, /c/home/wer/work and /e/gold had identical content and were really huge (say, 200 GBytes). After some complex, intricate work, Mr. Wer
2013 Mar 02
3
if value is in vector, perform this function
Hi, I'm trying to set up R to run a simulation of two populations in which every 3.5 days, the initial value of one of the populations is reset to 1.5. I'm simulation an experiment we did in which we fed Daphnia populations twice a week with algae, so I want the initial value of the algal population to reset to 1.5 twice a week to simulate that feeding. I've use for loops and if/else
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 Nov 15
1
Estimating model parameters for system of equations
Hi all, I'm trying to estimate model parameters in R for a pretty simple system of equations, but I'm having trouble. Here is the system of equations (all derivatives): eqAlgae <- (u_Amax * C_A) * (1 - (Q_Amin / Q_A)) eqQuota <- (p_max * R_V) / (K_p + R_V) - ((Q_A-Q_Amin)*u_Amax) eqResource <- -C_A * (p_max * R_V) / (K_p + R_V) eqSystem <- list(C_A = eqAlgae, Q_A = eqQuota,
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
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
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
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>
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?
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:
2011 Aug 24
3
UPS issues with PFC PSU
Just noticed that our new server has a newer 80+ efficiency 865W PSU with PFC. So apparenty our existing 1500VA (865W) APC Back-UPS is not safe to use anymore. We apparently need a pure sine wave UPS. http://nam-en.apc.com/app/answers/detail/a_id/8883 I found an affordable 1500VA UPS by CyberPower, model CP1500PFCLCD, which has a pure sine wave output. Wondering if anyone has experience with
2007 Jun 11
5
Highlight slowness
Has anyone else found that using ferret''s highlighting slows searches down significantly? I am seeing that it more than doubles the search time on my system. I am returning up to 500 results at once, so the slow down is quite noticeable (probably adding about .7 seconds for searches with large result sets.) --Paul -- Posted via http://www.ruby-forum.com/.
2005 Dec 26
3
data insertion in multiple tables
I have two tables like: Table A: id (autoincrement) name Table B id id_of_A desc I want to add a record to table A and based on the id of A, I want to add a record to table B. I don''t think there is any SQL command that support this (at least in MySQL 4.1, so I use LAST_INSERT_ID()). (Is there any other way? or MySQL 5 support any special SQL command?) But I need
2010 Dec 20
4
Subselection by URL
Hey guys, I''m quite new in RoR, so please excuse me when I may ask weird questions. I am working on a database frontend. The layout looks mostly like a has_many bs b has_many cs c has_many ds and so on. Now I want to do some selection. Maybe I want to see all ds belonging to a specific b. I would like to do it like: http://my.host/bs/1/ds When I click around there (add new ds, show a d