Displaying 20 results from an estimated 4000 matches similar to: "has_many.collection<<obj doesn''t set attributes?"
2007 Nov 22
2
Active Record Question
hey!
I have the following table structure in my DB
| users |
------------
| (pk)id |
| username |
| pass |
------------
(1:n)
| users_objects | | objectattributes |
------------------ ----------------------------------
| (fk,pk)user_id | (1:n) | (pk)attribute |
|(fk,pk)object_id| | (pk,fk)
2007 Jun 09
7
create 2 fk referencing the same table
Hi everyone! I have a problem with defining 2 fk referencing the same
table. I have a Program table and a Team table. The Program should
have an away team and a home team fk. From my understanding, "the fk
column should be named after the class of the target table, converted
to lowercase, with _id appended". But, in my case, I have 2 fk
referencing the same table. How can I do this?
2009 Jun 05
1
problem with using subset from two different tables
Hi all,
I am new to R-project my problem is I tried to get subset from two different
tables its giving error
but if i m tring for geting results from one table its working
actually i have to take values from two tables with applying different
conditions on two tables like
kk- is an object of one table and
fk- is an object of another table
here i have to get values from these tables like
2005 Jun 27
9
FK constraints overrated?
Hello folks,
I use to think that a relational databases without foreign keys
constraints enforced strictly by the RDBMS were no good, piece of crap,
data junk.
However, I''ve also learned the hard way that FKs constraints imposes
serious difficulties when moving data around, specially between
different DBs, or for loading test data or for upgrading DBs schemas, or
for porting DBs
2006 Apr 13
4
Creating an environment for a function.
I am trying to build a function in a context where the environment
concept would appear to be useful. But I'm a bit foggy about this
concept and would appreciate some pointers and advice.
Basically the function I'm building, say foo(x,t), is a function of
two variables). Depending on the value of t, foo will return one of
the values f1(x), f2(x), ..., fk(x), where each of f1, ..., fk is
2012 Jun 25
2
Fast Kendall's Tau
Hello.
Has any further action been taken regarding implementing David Simcha's fast Kendall tau code (now found in the package pcaPP as cor.fk) into R-base? It is literally hundreds of times faster, although I am uncertain as to whether he wrote code for testing the significance of the parameter. The last mention I have seen of this was in 2010
2019 Apr 12
5
players who cannot handle switching to a fallback mount point?
Hi Paul,
Thanks for the quick response!
We use the same type of encoder (Sam Cast) both live for both
mountpoints on 96 Kb Joint Stereo.
it is difficult to see if it is exactly the same. Is there a player that
show exactly this? I will check this.
We have use the limit-rate in our config. Thats work better for go to
play the last fallback-mount file (i test this).
See here our part of the
2018 Dec 07
3
Implement VLIW Backend on LLVM (Assembler Related Questions)
Hello,
I want to implement LLVM backend for a specific VLIW hardware. I am working
on defining its instruction set, and assembly language.
The hardware has two pipelines, int and float. Each pipeline can do 3
operations/cycle, 3 operations forms an instruction.
One of the Integer Instruction looks like this:
add Ri, Rj, Rk; add Rl, Rm, Rn; add Ro, Rp, Rq
An int instruction and a float
2006 Mar 20
11
has_many brings back ''uninitialized constant''
hello. first things first - I am new to ruby on rails (ruby, too), so
I''m figuring this is just a basic newbie error.
I''m creating a basic photography website. And I have two tables with a
relationship:
photos:
- id (set up as PK)
- title
- shutter
- aperture
- date
- the_order
...etc
photo_comments:
- id (set up as a PK)
- photos_id (set up as a FK)
- author
- date
-
2006 Mar 11
2
assignment of parent ID in child''s fk field
When I create a child record I''m not automagically getting the parent ID put into the fk field. Does object.new take parameters that allows me to do that as part of the AR record creation? Or do I need to do it separately? Or am I missing the boat altogether ;-)
Thanks,
Bill
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
2011 Feb 26
1
How to manage the form of a model that has two foreign keys
Hi,
Basically I have two models: User and Godfather. The godfather table
has three columns:
- user_id (FK --> User)
- user_godfather_id (FK --> User)
- description (text)
Inside each model class, I am adding the following associations:
class User < ActiveRecord::Base
has_many :godfathers # for user_id
has_many :godfathers, :foreign_key =>
2006 Aug 30
3
Damaged source medium during rsync
What happens when rsync'ing a file that is damaged bacause of a bad sector on
the source medium? I assume that the file will be synchronized partially,
overwriting any file of the same name on the destination medium. If that is
the case, is there a way to make rsync check readability of files before
overwriting them on the target medium (e.g. by synching to a temp. file and,
once
2010 Mar 30
2
setting up has_many
Do I have to manually set a column in a dependent table for the id of
the object to which it belongs?
I have a collection of objects called photos that are owned by a
analysis object. When I try to show an attribute of each of the photo
objects I get this error:
Mysql::Error: Unknown column ''photos.analysis_id'' in ''where clause'':
SELECT * FROM `photos` WHERE
2006 May 10
2
Why different directory sizes?
I just discovered two directories with the same number of files and the same
number of hard links but different size:
# stat /home/david/linuxburg/fax.old/docq_ps.nnnn \
/hdsync/home/david/linuxburg/fax.old/docq_ps.nnnn
File: `/home/david/linuxburg/fax.old/docq_ps.nnnn'
Size: 8192 Blocks: 16 IO Block: 4096 directory
Device: 801h/2049d Inode: 52060
2009 Sep 08
4
barplot with lines instead of bars
Dear useRs,
I want to plot the following barplot with lines instead of bars. Is there a way?
data <- data.frame(cbind(k = 0:3, fk = c(11, 20,7,2), f0k = c(13.72, 17.64, 7.56, 1.08), fkest = c(11.85, 17.78, 8.89, 1.48)))
d <- t(data[,2:4])
barplot(d, beside=TRUE)
Regards,
Rafael.
____________________________________________________________________________________
[[elided Yahoo
2009 Oct 08
6
Eager Loading a Relationship That Has No PK/FK
I''m attempting to wrestle an old DB into Rails.
This relationship is giving me trouble:
class Show < AR::Base
has_many :segments
end
class Segment < AR::Base
belongs_to :show
has_one :media #this has no PK/FK relation
end
A Segment is "linked" to Media by Media.name, which is the result of
concatenating Segment.name and Segment.part. As I said there are is no
2006 Jul 10
18
Deleting join association of has_many :through
I''m trying to use has_many :through, since my join model deserves being
more than just an intersection table.
But when I try to break the association, the break only seems
"temporary":
Let''s say my two tables are Users and Colors, and the join model is
Favorites.
user = Users.find(1)
user.colors.length
>> 2
c = user.colors.first
>> #<Color:....>
2005 Jul 25
2
acts_as_tree and traversing parent/child relationships
I am working on an Rails application that uses a pretty complex
category structure through out the site. I have defined a table to
house all the info and a FK to reference parents within the table
CREATE TABLE categories (
id int(11) NOT NULL auto_increment,
name varchar(50) NOT NULL,
parent_id int(11) default NULL,
constraint fk_category_id foreign key (category_id) references
2006 Jan 30
1
df reports false size
On a customer's machine running SuSE 9.2, the size of the occupied space on
the harddisk is reported incorrectly by "df -h". After we noticed the
problem, I rebooted the machine and had it checked by "e2fsck" (check forced
with "tune2fs -C 40", we are not on location). Right after the reboot I
proceeded as follows, but I could not find any information about
2009 Mar 09
3
multiple columns primary key
Hi all,
I have two tables:
TABLE 1
A pk - fk (referencesc TABLE 2)
B pk
C pk
D pk
E
F
TABLE 2
A pk
G
H
I
L
I don''t use incremental field (id). I''d like don''t use find_by_sql.
How can I define both models to use correctly find method (with
include)? With only one column primary key I haven''t problems.
I thought two solutions, but I don''t like these