Displaying 13 results from an estimated 13 matches for "to_id".
Did you mean:
t_id
2005 Mar 04
3
optimization
...eople WHERE
id = 1 LIMIT 1
[4;33mSkill Load (0.094000) [1;37mSELECT * FROM skills WHERE
name = ''SQL''
[4;35mPerson Load (0.203000) [0;37mSELECT * FROM people WHERE
id = 1 LIMIT 1
[4;33mPerson Load (0.141000) [1;37mSELECT people.* FROM
people JOIN relations ON relations.to_id = people.id WHERE
relations.from_id = 1 AND (relations.relationship = ''romantic'' OR
relations.relationship = ''friend'')
[4;35mPerson Load (0.140000) [0;37mSELECT people.* FROM
people JOIN relations ON relations.to_id = people.id WHERE
relations.from_id = 1 AND...
2010 Jun 08
3
partial matches across rows not columns
...l_dist) is below:
A quick break down of my coding and why I need to answer this - I am dealing
with a colony of seals where for example A1 is a female with pup and A1.1 is
that female's pup, the important part of the data here is DIST which tells
the distance between one seal (ID) and another (TO_ID). What I want to do is
take a mean for these data for a nearest neighbour analysis but I want to
omit any cases where there is the distance between a female and her pup,
i.e. in the previous e.g. omit rows where A1 and A1.1 occur.
I have looked at grep and pmatch but these appear to work across c...
2007 Jan 03
3
Self-referential habtm with condition is broken
...implistic model class.
class Person < ActiveRecord::Base
has_and_belongs_to_many :relatives,
:class_name => ''Person'', :join_table => ''relatives'',
:foreign_key => ''from_id'', :association_foreign_key => ''to_id''
has_and_belongs_to_many :brothers,
:class_name => ''Person'', :join_table => ''relatives'',
:foreign_key => ''from_id'', :association_foreign_key => ''to_id'',
:conditions => "gende...
2010 Nov 30
4
Cucumber+Capybara rails 3 issue (Don't know where exactly)
...;."id"
= 1061) LIMIT 1
CACHE (1.1ms) SELECT "users".* FROM "users" WHERE ("users"."id" =
1061) LIMIT 1
PrivateMessage Load (1.2ms) SELECT DISTINCT(private_messages.id)
FROM "private_messages" LEFT JOIN private_messages_users mu ON
mu.to_id = 1061 WHERE (((mu.private_message_id = private_messages.id
and mu.to_status = ''unread'') or (priv
ate_messages.user_id = 1061 and private_messages.user_status =
''unread'')))
SQL (0.5ms) SELECT COUNT(*) AS count_id FROM "private_messages"
WHERE ("...
2006 Jan 28
13
What''s the verb form of id?
Random question:
I''ve written a method for the String class that turns an arbitrary
line of text in to an identifier, e.g.:
"My, what a beautiful day!"
=> "my_what_a_beautiful_day"
"(anb*#NF(AMNV"
=> "anb_NF_AMNV"
We''ve got all these great names already like underscore, classify,
titleize and things like that. I''d
2006 Aug 14
1
2 foreign keys to one table
Hi,
I have a messaging class that has to relationships to one table
belongs_to :user, :foreign_key => "from_id"
belongs_to :user, :foreign_key => "to_id"
At the min I can specify message.user.login and it will return the
username of last relationship to that table.
how can I get it to bring back both references
ie message.from.login and message.to.login
thanks
scott
--
Posted via http://www.ruby-forum.com/.
2010 Jun 01
2
storing output data from a loop that has varying row numbers
...my loop would be:
for (i in 1:33){
SEL_DAY<-seal_dist[seal_dist[,10]==i,]
print(paste("DAY", i, "of 33"))
for (s in 1:11){
SEL_HR<-SEL_DAY[SEL_DAY[,5]==s,]
print(paste("HR", s, "of 11"))
indx <- subset(SEL_HR, SEL_HR$DIST == 0)
SEL_HR$TO_ID <- indx$ID[match(SEL_HR$TO, indx$TO)]}
}
where i is day and s is the hr within the day, the loop works fine because
it prints as i expect it too. I have not given any info on the data because
I assume this is more of a method question and will be very straight forward
to most people on here!? B...
2006 May 16
9
Array in database?
Hello, I wanted to know how to make an aray in the database. I''m making
a "backpack" for my game. So i''m gana use it in a array.
--
Posted via http://www.ruby-forum.com/.
2006 May 03
11
Curse words
Hello, I just had a problem with someone cusing on my rail app now is
there somthing like Red Cloth that I can use to disable ''dirty words''
--
Posted via http://www.ruby-forum.com/.
2006 Aug 01
8
Dumb views?
Hello again! I''ve another "what would you do in this situation" question.
You''ve got 6 controllers, one named base. The other 5 controllers extend
base. Currently they share one layout.
Your layout displays navigation. However, there are two actions inside base
for which you do not want navigation displayed (index, new).
Do you...
a) Add logic to your layout telling
2005 Dec 19
4
need some help designing my messaging system
...ime designing my db. This is what i have in mind, but I am not
sure if its the best approach.
user has_one inbox
user has_one outbox
inbox has_many messages
outbox has_many messages
inbox table
user_id
outbox table
user_id
messages table
box_id (refers to either inbox or outbox - how?)
from_id
to_id
msg_status (new, sent, read, deleted, etc.)
subject
body
does this make sense? is there a better way of acheiving this? since
both inbox and outbox both have many messages, how do I created the
association between them? will the addition of a from_id and to_id in
my messages table slow anything do...
2007 Sep 07
4
Ferret DRB - can add/edit index, but can''t search
...iple mongrels. I can successfully add and edit data on my
index via the DRB server, however, when I search the index, I get the
following error:
DRb::DRbConnError (DRb::DRbServerNotFound):
/usr/lib/ruby/1.8/drb/drb.rb:1647:in `current_server''
/usr/lib/ruby/1.8/drb/drb.rb:1709:in `to_id''
/usr/lib/ruby/1.8/drb/drb.rb:1045:in `initialize''
/usr/lib/ruby/1.8/drb/drb.rb:639:in `make_proxy''
/usr/lib/ruby/1.8/drb/drb.rb:556:in `dump''
/usr/lib/ruby/1.8/drb/drb.rb:600:in `send_request''
/usr/lib/ruby/1.8/drb/drb.rb:599:in `sen...
2007 Dec 13
16
"Tricks" for testing after_create callback???
I''ve got a model Message, which needs to send an email using action
mailer after it''s first saved in the database.
I want to pass the model to the mailer which then uses methods on the
message model to render the email.
So the natural way to do this is in an after_create callback on the
Message model.
But I can''t see an easy way to test this. Here''s my spec