Displaying 20 results from an estimated 22 matches for "a_id".
Did you mean:
_id
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/.
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
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 belongs_to
link to one B (and vice versa).
So
a = A.find(:first)
b = a.bs.first...
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
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: Talk" group.
To post to this group, send email to rubyonrails-tal...
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...
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_attr...
2006 Dec 30
2
search on multiple table
...nd_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, name
Table c have field : id, name
Table c_a have field :a_id, c_id
Any idea on how to include c on my search ?
--
Posted via http://www.ruby-forum.com/.
2005 Mar 29
1
Problem installing packages and weird R site behaviour
...;- CRAN.packages()
+ install.packages(select.list(a[,1],,TRUE), .libPaths()[1], available=a,
dependencies=TRUE)})
trying URL `http://cran.r-project.org/bin/windows/contrib/2.0/PACKAGES'
Content type `text/html' length unknown
opened URL
downloaded 953 bytes
Problem 2
{ttp://64.235.246.142/?a_id=794&adultfilter=on&domainname=r-project.org}
Alex Hanke
Department of Fisheries and Oceans
St. Andrews Biological Station
531 Brandy Cove Road
St. Andrews, NB
Canada
E5B 2L9
[[alternative HTML version deleted]]
2011 Nov 03
0
Arel table aliases and ActiveRecord::Relation help: how to specify "multiple has_many items in a query"
...recommended way to use table aliases with
ActiveRecord::Relation these days?
In prior versions of Rails, this would work:
assume (pseudo code):
model A
has_many b''s
model B
,,,
at = B.arel_table
atalias = at.alias(at.name + "_1")
A.join(:b).join(atalias).where(atalias[:a_id].eq(at[:a_id]).where("b.widget
= ''foo''").where("b_1.widget = ''bar''"). ...
^ probably should be "on"
now in 3.1.1: passing in a arel_table into join ... returns a String,
not a relation, breaking the A...
2006 Jul 29
1
creating and storing records in Ruby
...elationship
between A and B.
What if I want to take ones that don''t exist in params[:clubs] and have
those added to Club table? Is there any shortcut operator for doing that
AND also does the << operation at the same time?
Question 2
In a one-to-many relationship, where I have a_id column in my b table,
how do I take many records that have to go in b and get ActiveRecord to
either create new entries OR update the ones that exist.
Do I have to find_all and delete all of them and then reenter them into
the database. It seems like there would be smarter mechanism in Ruby for...
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 CyberPower UPS's. Are they any
good? Any problems with pwrstatd ?
--
Robert Arkiletian
Eric Hamber Secondary, Vancouver, Canada
2012 Aug 01
5
[Full-disclosure] nvidia linux binary driver priv escalation exploit
Hi all!
I found this today on FD:
http://seclists.org/fulldisclosure/2012/Aug/4
2012 Jan 02
2
Errors trying to run ControlCenter.exe
...;t know in what dll they reside. How can I find out?
wine-1.3.35 with ie8, mfc42 and access runtime installed from winetricks.
Any help is appreciated. I am not too familiar with the internals of wine.
Regards,
Brian
[1] - What is Q-See CMS software (http://qsee.custhelp.com/app/answers/detail/a_id/1044)
2015 May 15
0
asterisk-users Digest, Vol 130, Issue 14
...Steve
>
>Steve,
>That is an interesting point - the server and the phone are both connected
to Netgear switches where I have enabled their "Auto-VoIP" feature, which
remarks packets based on protocol (SIP, SCCP, etc) for better QoS:
>http://kb.netgear.com/app/answers/detail/a_id/21758
>I wonder if this remarking process is modifying another part of the packet
too?
>Both devices are on the same subnet, so although these switches do route
traffic as well, that shouldn't be coming into play here.
We had a very specific issue at a client recently with Yealink phone...
2015 May 13
1
"Retransmission Timeout" results in dropped calls after 32 seconds
Hi,
In my experience, all Yealink phones work just fine with Asterisk, we have
hundreds (perhaps even low-thousands) out there with customers on Asterisk
1.2, 1.6.2, 1.8 and 11.
If you are accurately representing the SIP trace on the phone and the SIP
trace on Asterisk, then I would strongly suggest a SIP ALG exists in the
network between the two devices and that SIP ALG does not understand SIP
2007 Oct 04
12
Rails' abilities fitting?
Hi,
I''m looking at developing a reasonably complex web application, where
most of the complexity actually lays in the database and the queries
I need run on it. Some "classes" or models need to consist of an
assembly of several tables. It would be trivial enough for me to code
these queries in SQL, but as far as I understand Rails is trying to
hide the database as
2007 Sep 23
3
Connecting a row of an unknown table to another row of an unknown table
...#39;'-----------------------------------''
My first idea was to create three extra join tables, "genre_genres",
"element_elements", and "genre_elements". I realized, however, that I
could collapse that into one "connections" table:
id :integer
a_id :integer
b_id :integer
a_class_name :string
b_class_name :string
The _id''s can hold either/both the id of a genre or an element; likewise
the _class_name''s can hold either/both "genre" or "element".
However, that would require hacking together a custom Activ...
2013 Oct 28
46
[Bug 70972] New: Nouveau fails with broken screen on nv40 with kernel 3.12
https://bugs.freedesktop.org/show_bug.cgi?id=70972
Priority: medium
Bug ID: 70972
Assignee: nouveau at lists.freedesktop.org
Summary: Nouveau fails with broken screen on nv40 with kernel
3.12
QA Contact: xorg-team at lists.x.org
Severity: major
Classification: Unclassified
OS: Linux (All)
2010 Jun 11
5
Issues creating tables in mysql tests
Hello,
I''m a beginner, so any hints are appreciated; I''m still trying to find my
way around Rails code. For a bug I''ve found I need to create a table called
"values" so I added this:
create_table :values do |t|
t.integer :value
end
among the other table creations in
activerecord/test/cases/migration_test.rb. Is that ok? But then, when I run
the tests